如何在GridView中为动态创建的DropDownList创建SelectedIndexChange事件 [英] How to Create SelectedIndexChange Event For Dynamically Created DropDownList In GridView

查看:98
本文介绍了如何在GridView中为动态创建的DropDownList创建SelectedIndexChange事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我动态地将行添加到gridview,其中包含下拉列表和Label控件,我想要下拉列表中选定的索引更改事件。请建议我的解决方案。

Hi,
I am dynamically adding the row to the gridview which contains the dropdownlist and Label controls, I want the selected index change event of the dropdownlist. Please suggest me solution for that.

推荐答案

没有选择按钮的Fire GridView SelectedIndexChanged事件 [ ^ ]


protected void dropdown_SelectedIndexChanged(object sender, EventArgs e)
   {
       GridViewRow grdRow = ((TextBox)sender).Parent.Parent as GridViewRow;
       DropDownList dropdown = (DropDownList)grd.Rows[grdRow .RowIndex].FindControl("dropdown");
  }


检查:



如何在GridView中的EditItemTemplate上触发下拉列表selectedIndexChanged ....请帮我解决这个问题...我是asp.net的新手... thnx提前 [ ^ ]


这篇关于如何在GridView中为动态创建的DropDownList创建SelectedIndexChange事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆