Checkbox return nullable value with editform usercontrol on grid

2 posts, 0 answers
  1. Flyznex
    Flyznex avatar
    3 posts
    Member since:
    May 2016

    Posted 11 May Link to this post

    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>

  2. Flyznex
    Flyznex avatar
    3 posts
    Member since:
    May 2016

    Posted 12 May Link to this post

    I have solved my problem with handle OnNeedDataSource event in my grid!
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top