DropDownList 如何绑定 键值对 DropDownList1.DataTextField=??DropDownList1.DataValueField= ????处 该如何绑定键值对的值? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 DataTextField 是窗体显示的值DataValueField 是窗体存储的值比如: 省市区的绑定 省 的 中文 湖南 需要DataTextField 去绑定sql 字段的文本值湖南对应的ID值 比如112 DataValueField 去绑定sql 字段的值 DropDownList1.DataSource=List<>;DropDownList1..DataTextField="";//数据库中选择出的字段,要显示的文本;DropDownList1.DataValueField="";//数据库中选择出的字段,该项的值; DropDownList1.DataSource = 你的数据集DropDownList1.DataTextField=显示的列DropDownList1.DataValueField= 取得值的列 http://apps.hi.baidu.com/share/detail/24618273 楼上说的很全面。Value就是键 Text是值 DropDownList1..DataTextField="";//数据库中选择出的字段,要显示的文本;DropDownList1.DataValueField="";//数据库中选择出的字段,该项的值; 先要前面为下拉列表指定数据来源``` /// <summary> /// 绑定比例下拉列表 /// </summary> private void LoadZoom() { Dictionary<int, string> ites = new Dictionary<int, string>(); ites.Add(0, "100%"); ites.Add(1, "75%"); ites.Add(2, "50%"); ites.Add(3, "25%"); ites.Add(4, "10%"); for (int i = 0; i < ites.Count; i++) { tsbtnZoom.Items.Add(ites[i].ToString()); } tsbtnZoom.SelectedIndex = 0; //默认为100% } DropDownList1.DataTextField="key";DropDownList1.DataValueField= "value";正确答案! C# 2010中Chart應該問題 谁有VS2010专业版、旗舰版。。。 关于多线程的问题 C# 打包问题 高分求助,如何把Html的一个table 转换成 C# DataTable C# 新手的问题.不要见笑 水晶报表文本框显示字数问题!急啊!还希望各位高人帮忙解决一下!小弟万分感谢! 中文显示为乱码的问题 接收键盘输入,响应KEYPRESS事件? 我在webform里面放了一个按钮,现在想单击按钮后让当前浏览器关闭,怎么实现 c#如何将设置写入TXT中的格式! 如何在暂停时获得视频的图像。。。
DataValueField 是窗体存储的值比如: 省市区的绑定 省 的 中文 湖南 需要DataTextField 去绑定sql 字段的文本值湖南对应的ID值 比如112 DataValueField 去绑定sql 字段的值
DropDownList1..DataTextField="";//数据库中选择出的字段,要显示的文本;
DropDownList1.DataValueField="";//数据库中选择出的字段,该项的值;
DropDownList1.DataTextField=显示的列
DropDownList1.DataValueField= 取得值的列
Value就是键 Text是值
DropDownList1.DataValueField="";//数据库中选择出的字段,该项的值; 先要前面为下拉列表指定数据来源```
/// 绑定比例下拉列表
/// </summary>
private void LoadZoom()
{
Dictionary<int, string> ites = new Dictionary<int, string>();
ites.Add(0, "100%");
ites.Add(1, "75%");
ites.Add(2, "50%");
ites.Add(3, "25%");
ites.Add(4, "10%");
for (int i = 0; i < ites.Count; i++)
{
tsbtnZoom.Items.Add(ites[i].ToString());
}
tsbtnZoom.SelectedIndex = 0; //默认为100%
}
DropDownList1.DataTextField="key";
DropDownList1.DataValueField= "value";正确答案!