【发布时间】:2018-08-23 03:26:08
【问题描述】:
我的 Telerik RadGrid 中有一个 Telerik RadDropDownList,它的编辑模式是 FormTemplate。当我更改 RadDropDownList 时,它在插入模式下运行良好,但在编辑模式下出现错误。
InvalidCastException = "无法将 'Telerik.Web.UI.GridEditFormItem' 类型的对象转换为 '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;
}
}
【问题讨论】:
标签: c# asp.net telerik dropdown radgrid