- I am beginner and question or syntax may be silly.
- I have drawn a grid view having based on a SqlDataSource query.
- Converted a status field into Bit.
- a checkbox is automatically created.
now how can i get the value of checkbox on SelectedIndexChanged.
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
Panel_Entry.Visible = true;
int i = GridView1.SelectedIndex;
String vDescr = GridView1.Rows[i].Cells[2].Text;
CheckBox chk = (CheckBox)GridView1.Rows[i].FindControl("BitStatus");
Response.Write(chk.ToString()+vDescr);}
System.NullReferenceException: Object reference not set to an instance of an object.
error is shown. please help in this regard.