This is a migrated thread and some comments may be shown as answers.

Checkbox return nullable value with editform usercontrol on grid

1 Answer 81 Views
CheckBox
This is a migrated thread and some comments may be shown as answers.
Flyznex
Top achievements
Rank 1
Flyznex asked on 12 May 2016, 02:42 AM

I use usercontrol editform in my grid. But, when "Update" button click, all RadCheckBox item in edit form can't get a value

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 value on runtime
7.bool isToBoss = chkFwdToBoss.Checked.Value;//Error:will return exception nullable value on runtime
8.bool isToEmp = chkFwdToEmp.Checked.Value;//Error: will return exception nullable value on runtime
And my reference Control in 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>

1 Answer, 1 is accepted

Sort by
0
Flyznex
Top achievements
Rank 1
answered on 13 May 2016, 02:25 AM
I have solved my problem with handle OnNeedDataSource event in my grid!
Tags
CheckBox
Asked by
Flyznex
Top achievements
Rank 1
Answers by
Flyznex
Top achievements
Rank 1
Share this question
or