With telerik aps.net ajax, I use usercontrol editform in my grid. But, when "Update" button click, all RadCheckBox item in edit form can't get a checked state
In my OnUpdateCommand of my grid
1.GridEditableItem editedItem = e.Item as GridEditableItem;
2.UserControl myControl = (UserControl) e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
3.RadCheckBox chkFwd = myControl.FindControl("rad_chkFwd") as RadCheckBox;
4.RadCheckBox chkFwdToBoss = myControl.FindControl("rad_chkFwdToBoss") as RadCheckBox;
5.RadCheckBox chkFwdToEmp = myControl.FindControl("rad_chkFwdToEmp") as RadCheckBox;
6.bool isForward = chkFwd.Checked.Value; //Error:will return exception nullable object on runtime
7.bool isToBoss = chkFwdToBoss.Checked.Value;//Error:will return exception nullable object on runtime
8.bool isToEmp = chkFwdToEmp.Checked.Value;//Error: will return exception nullable object on runtime
My reference usercontrol template for editform
01.<td>
02. <telerik:RadCheckBox runat="server" ID="rad_chkFwd" OnClientCheckedChanged="FwdChanged" OnClientLoad="FwdChanged" AutoPostBack="False" Text="Forward" />
03.</td>
04.<td>
05. <telerik:RadCheckBox runat="server" ID="rad_chkFwdToBoss" OnClientCheckedChanged="ShowBoss" OnClientLoad="ShowBoss" AutoPostBack="False" Text="Forward Up Level"/>
06.</td>
07.<td>
08. <telerik:RadCheckBox runat="server" ID="rad_chkFwdToEmp" OnClientCheckedChanged="ToEmployee" OnClientLoad="ToEmployee" AutoPostBack="False" Text="Forward Down Level" />
09.</td>
chkFwd, chkFwdToBoss, chkFwdToEmp already not null. But their property "Checked" is null. what is problem?( sorry for my english)
Aucun commentaire:
Enregistrer un commentaire