使用下拉列表动态创建行 [英] Dynamically create rows with drop down list

查看:69
本文介绍了使用下拉列表动态创建行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用下拉列表创建动态行,并且每个行的下拉值都不同。任何人都知道请给我你的解决方案...

解决方案

这可能对你有所帮助



 Dropdownlist.Items.Insert( int  index,ListItem( String  text,  String  Value)); 



例如:如果你想在你的下拉列表中添加select项列表(ddl)在索引= 0

然后它编码如



 ddl.Items.Insert(  0  new  ListItem( 选择  0)); 


How to create dynamic rows with dropdown list and the dropdown values differ from each rows. Any one know pls give me your solutions...

解决方案

This might be helpfull to you

Dropdownlist.Items.Insert(int index, ListItem(String text, String Value));


for eg:If you want to add a item "select" to your dropdown List (ddl) at index=0
then it codes like

ddl.Items.Insert(0, new ListItem("Select", "0"));


这篇关于使用下拉列表动态创建行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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