Grab data from Datagrid

Results 1 to 2 of 2

Thread: Grab data from Datagrid

  1. #1
    Join Date
    Dec 1969

    Default Grab data from Datagrid

    Hi,<BR>I have a column by name ApplicantID in a datagrid. I have hidden that column. SO when a user selects a particular row from the grid I would like to grab the corresponding applicantID associated in that row...All the columns are templated.It will be great if someone could tell me the syntax for the same.<BR>About DG: Datagrid comprises of 3 columns exclusing the hidden column. One of the column has a "select button" associated with each row(templated col again). I am able to grab the corresponding data from the columns that are visible but not from the applicantId column.<BR><BR>It is really important..please reply asap!<BR><BR>Thanks,<BR>Vaikkam

  2. #2
    Join Date
    Dec 1969

    Default RE: Grab data from Datagrid

    Instead of datagrid column use a lable. In one of the template columns write the following code.<BR><BR>&#060;asp:Lable id="lblApplicantID" runat="server" Text=&#039;&#060;%# Container.DataItem("ApplicantID") %&#062;&#039; Visible="false" /&#062;<BR><BR>In the sub associated to the event you can find the ApplicantID<BR><BR>strApplicantID = CType(datagrid.Items(e.Items.ItemIndex).FindContro l("lblApplicantID"),Label).Text where e is the EventArgs<BR><BR>I hope that the above code will solve your problem. If not let me know<BR><BR>Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts