C# .net Dropdownlist 设置首选项为空
答案:3 悬赏:30 手机版
解决时间 2021-04-28 03:55
- 提问者网友:未信
- 2021-04-27 06:06
C# .net Dropdownlist 设置首选项为空
最佳答案
- 五星知识达人网友:我住北渡口
- 2021-04-27 06:32
ddlTempTianbaoren.DataSource = datset;
ddlTempTianbaoren.DataTextField = "姓名";
ddlTempTianbaoren.DataBind();
ddlTempTianbaoren.Items.Insert(0, new ListItem());
ddlTempTianbaoren.DataTextField = "姓名";
ddlTempTianbaoren.DataBind();
ddlTempTianbaoren.Items.Insert(0, new ListItem());
全部回答
- 1楼网友:鱼忧
- 2021-04-27 08:38
1 ddlTempTianbaoren.DataSource = datset;
2 ddlTempTianbaoren.DataTextField = "姓名";
3 ddlTempTianbaoren.DataBind();
4 ddlTempTianbaoren.Items.Insert(0, new ListItem());
- 2楼网友:鱼忧
- 2021-04-27 07:11
使用重定义代码,即可设置首选项为空。代码如下:
ddlTempTianbaoren.DataSource = datset;
ddlTempTianbaoren.DataTextField = "姓名";
ddlTempTianbaoren.DataBind();
ddlTempTianbaoren.Items.Insert(0, new ListItem());
ddlTempTianbaoren.DataSource = datset;
ddlTempTianbaoren.DataTextField = "姓名";
ddlTempTianbaoren.DataBind();
ddlTempTianbaoren.Items.Insert(0, new ListItem());
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯