Last post Jan 24, 2017 11:39 PM by Gleeming
Jan 24, 2017 02:07 AM|Gleeming|LINK
I am creating a DynamicGridView control loading it from a data table which is read from the database. One of the columns in the GridView has a check box control in it.
When checked I would like the checkbox to postback to the C# code so I created an event handler on line 9 below for the checkbox control. However I am not getting postback on
the Check box control when I check or uncheck the checkbox. Does anyone have any idea how I can get postback when the Checkbox is clicked? On line 10 below I do set autopostback = true, but it still does not work.
1 protected void Gridview1_RowDataBound(Object sender, GridViewRowEventArgs e)
3 if (e.Row.RowType == DataControlRowType.DataRow)
5 CheckBox cb = (CheckBox)e.Row.Cells.Controls;
6 if(!(cb == null))
8 cb.Enabled = true;
9 cb.CheckedChanged += new EventHandler(Cb_CheckedChanged);
10 cb.AutoPostBack = true;
private void Cb_CheckedChanged(object sender, EventArgs e)
bool stopHere = true;
Jan 24, 2017 11:39 PM|Gleeming|LINK