If you have a TemplateField inside the columns of your GridView , and you have, say, a control named blah associated with it. Then put outlook_id as a HiddenField like this:
<asp:TemplateField HeaderText="OutlookID"> <ItemTemplate> <asp:Label ID="blah" runat="server">Existing Control</asp:Label> <asp:HiddenField ID="HiddenOutlookID" runat="server" Value='<%#Eval("Outlook_ID") %>'/> </ItemTemplate> </asp:TemplateField>
Now take the line in case you want outlook_id and then access the control.
For RowDataBound use it like:
string outlookid = ((HiddenField)e.Row.FindControl("HiddenOutlookID")).Value;
Come back if you have problems accessing the pressed row. And do not forget to indicate the event in which you would like to access.
naveen Mar 21 '11 at 10:44 2011-03-21 10:44
source share