当前位置: 代码迷 >> ASP.NET >> DataGrid中怎么读取模板列中DropDownList选中的值
  详细解决方案

DataGrid中怎么读取模板列中DropDownList选中的值

热度:2977   发布时间:2013-02-26 00:00:00.0
DataGrid中如何读取模板列中DropDownList选中的值
DataGrid中加入DropDownList模板列
DropDownList中已经绑定数据
现求如何读取DataGrid选定行中DropDownList的值

------解决方案--------------------------------------------------------
把相应的列专为模板列侯
后:
DropDownList ddl=(DropDownList )(e.Item.cell[i].FindControl( "DropDownList1 "))

这样。。你就可以把ddl当成你要的控件,进行常规的操作就好了

比如string s=ddl.SelectedValue.ToString();

  相关解决方案