dropdownlist绑定数据后如何能将显示置空 dropdownlist绑定数据源后,运行程序,总是自动选择第一条数据,我想让他默认不选择任何数据,怎样设定才能做到? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 绑定后yourdropDownList.Items.Insert(new ListItem(0,"")); 插入一个空行..Items.Insert(new ListItem(0,"")); 在程序初始化得时候加如下代码dplist.Items.Insert(new ListItem(0,"--请选择--")); 这样可以吗?怎么ListItem()类的第一个参数要求是string类型的啊!? 在绑定的同时插入一项this.DropDownList1.DataSource =ds;this.DropDownList1.DataTextField ="字段一";this.DropDownList1.DataValueField ="字段二";this.DropDownList1.Items.Insert(0,"---请选择---");this.DropDownList1.DataBind(); this.DropDownList1.Items.Add("");this.DropDownList1.selectItem.text = ""; 有没有其他方式可代替Properties.Settings来存储数据? sql update返回受影响的行数大于0,但是数据库记录无变化是怎么回事? .NET页面运行占用内存的问题 第一次工作就遇到这么惨的事情,aspx页面完全变形了?? AccessDataSource 无法连接数据库 vs2005无法显示登录图片 调试时出现线程间操作无效的问题 C#中遇到的如下错误提示,不知道具体怎么改正,望高手指教 请问有关树的问题! 关于明华读卡器,C#开发,修改密码问题 请问,如何得到最靠前窗口的名称 c# 获取本地IP 期待解决
yourdropDownList.Items.Insert(new ListItem(0,""));
Items.Insert(new ListItem(0,""));
加如下代码
dplist.Items.Insert(new ListItem(0,"--请选择--"));
this.DropDownList1.DataTextField ="字段一";
this.DropDownList1.DataValueField ="字段二";
this.DropDownList1.Items.Insert(0,"---请选择---");
this.DropDownList1.DataBind();
this.DropDownList1.selectItem.text = "";