I add by code my checkboxlist in ItemDataBound event
In RadGrid1_ItemUpdated event i try to retrive the checkboxlist
This is the error:
{"Cannot find a cell bound to column name 'MyCheckLst'"} System.Exception {Telerik.Web.UI.GridException}
If I edit the row I can see the checkboxlist, but if I show page HTML I have not any checkboxlist!!!
Please, HELP!!!
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
CheckBoxList chkLst = null; // add checkboxlist only in edit item |
if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode)) |
{ |
chkLst = new CheckBoxList(); |
chkLst.ID = "MyCheckLst"; |
lst = new ListItem("Item1", "1"); |
chkLst.Items.Add(lst); |
lst = new ListItem("Item2", "2"); |
chkLst.Items.Add(lst); // Add checkboxlist to CheckBox (every checkbox have a checkboxlist) (GridEditableItem)e.Item["MyCheck" ].Controls.Add(chkLst);
|
} |
protected void RadGrid1_ItemUpdated(object source,Telerik.Web.UI.GridUpdatedEventArgs e) |
{ |
CheckBoxList cbl = (CheckBoxList)e.Item["MyCheckLst"].Controls[0]; |
} |
{"Cannot find a cell bound to column name 'MyCheckLst'"} System.Exception {Telerik.Web.UI.GridException}
If I edit the row I can see the checkboxlist, but if I show page HTML I have not any checkboxlist!!!
Please, HELP!!!