I have a RadDropDownList in my RadGrid ,which editmode is FormTemplate. When I change RadDropDownList it work good in insert mode but in edit mode it got InvalidCastException = "Unable to cast object of type 'Telerik.Web.UI.GridEditFormItem' to type 'Telerik.Web.UI.GridEditFormInsertItem'."
protected void TransactionTypeTextBox_SelectedIndexChanged(object sender, DropDownListEventArgs e) { RadDropDownList dropdownlist1 = (RadDropDownList)sender; GridEditFormInsertItem item = (GridEditFormInsertItem)dropdownlist1.NamingContainer; Panel Panel1 = (Panel)item.FindControl("Panel1"); if (dropdownlist1.SelectedItem.Text == "Cheque") { Panel1.Visible = true; } else if (dropdownlist1.SelectedItem.Text == "Cash") { Panel1.Visible = false; } }