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

Access Grid Edit Form template InsertItem & EditItem events from RadDropDownList selectedindexchanged

0 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
SURYA
Top achievements
Rank 2
SURYA asked on 22 Aug 2018, 06:35 PM

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;
          }
      }

No answers yet. Maybe you can help?

Tags
Grid
Asked by
SURYA
Top achievements
Rank 2
Share this question
or