CheckBox CheckedChange event in RadGridEditForm

szabi42

New Member
PnNeI.png
I have a RadGridEditForm Template, Where i have checkBox and RadComboBox.So it contains 2 buttons1st-Add New Record (Which is GridEditFormInsertItem)2nd- Edit(To edit the existing record.)I want to Disable the RadComboBox when the checkbox is *CHECKED*I used to folowing code its working fine with 'Add New Record' but not when i click on Edit button its showing error as-\[code\]Unable to cast object of type 'Telerik.Web.UI.GridEditFormItem' to type 'Telerik.Web.UI.GridEditFormInsertItem'.\[/code\]My code for checkedChanged Event is\[code\] protected void chkEHalfDay_CheckedChanged(object sender, EventArgs e){ CheckBox chkHalfDay = (CheckBox)sender; GridEditFormInsertItem item = (GridEditFormInsertItem)chkHalfDay.NamingContainer; if (chkHalfDay.Checked == false) { ((RadComboBox)item.FindControl("rcbHalfDayType")).Enabled = false; } else { ((RadComboBox)item.FindControl("rcbHalfDayType")).Enabled = true; }}\[/code\]Please Suggest where i went wrong.Thanks in Advance.
 
Back
Top