protected void gvMeatDispatch_RowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
DataTable dtpartyname = new DataTable();
objRetailPL.status = 4;
dtpartyname = objRetailBAL.GetType(objRetailPL);
DropDownList ddlpn = (DropDownList)e.Row.FindControl("ddlpartyname");
if (ddlpn != null)
{
// ddlpn.SelectedIndexChanged += new EventHandler(ddlbranchdate_SelectedIndexChanged);
ddlpn.Items.Add(new ListItem("--Select--", "0"));
ddlpn.SelectedIndex = ddlpn.Items.Count - 1;
}
}
}
这里ddlpn.SelectedIndexChanged事件没有被解雇,...请帮帮我 如何在Gridview RowDataBound事件中调用dropdownlist selectedindexchanged事件
答案 0 :(得分:1)
您需要处理嵌套在SelectedIndexChanged
内的DropDownList
的{{1}},您必须将GridView
属性设置为true,并将AutoPostback
事件指向某个过程。
问题的原因是我没有检查Page_Load函数(在将数据绑定到GridView期间)遵循以下规则:SelectedIndexChange
。这就是全部。
答案 1 :(得分:0)
确保您在代码中声明了以下事件
void ddlpn_SelectedIndexChanged(object sender, EventArgs e)