You question is too unclear and I'm not entirely sure if I follow you correctly. If you are trying to access a
Column
value when a
CheckBox
is checked then you can do something like this:
ASPX:
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true" OnCheckedChanged="CheckBox1_CheckedChanged" />
</HeaderTemplate>
</asp:TemplateField>
You can then cast the sender to get reference to the
CheckBox
at
CheckedChanged
event like:
protected void CheckBox1_CheckedChanged(object sender, EventArgs e){
CheckBox cb = (CheckBox)sender;
if (cb.Checked){
GridViewRow row = (GridViewRow)cb.NamingContainer;
}
else {
}
}