checkbox CheckedChanged event not firing after conversion to .net 3.5
-
I have a gridview that is in a webpart, , one column is a checkbox column. in the grid_row created event I set the proberties for the check box like so:
private void Grid_RowCreated(object sender, GridViewRowEventArgs args) { TableCell cell; CheckBoxField column; CheckBox checkBox; if (args.Row.RowType == DataControlRowType.DataRow) { for (int i = 0; i < args.Row.Cells.Count; i++) { cell = args.Row.Cells[i]; column = Grid.Columns[i] as CheckBoxField; if (column != null) { foreach (System.Web.UI.Control ctl in cell.Controls) { checkBox = ctl as CheckBox; if (checkBox != null) { CaseCategory dataObj = args.Row.DataItem as CaseCategory; if (dataObj != null) { checkBox.ID = dataObj.CategoryId.ToString(System.Globalization.CultureInfo.InvariantCulture); } checkBox.AutoPostBack = true; checkBox.EnableViewState = true; checkBox.CheckedChanged +=new EventHandler(checkBox_CheckedChanged); checkBox.Enabled = true; } } } } } }
before converting this code worked perfectly, after the event does not get fired. I have removed the scriptmanager and related controls from the page, with no effect. does anyone have any ideas what is going wrong, or how to fix it?