DropDownList1.DataTextField=??
DropDownList1.DataValueField= ????处 该如何绑定键值对的值?

解决方案 »

  1.   

    DataTextField  是窗体显示的值
    DataValueField  是窗体存储的值比如:  省市区的绑定    省 的 中文  湖南  需要DataTextField  去绑定sql 字段的文本值湖南对应的ID值 比如112    DataValueField  去绑定sql 字段的值
      

  2.   

    DropDownList1.DataSource=List<>;
    DropDownList1..DataTextField="";//数据库中选择出的字段,要显示的文本;
    DropDownList1.DataValueField="";//数据库中选择出的字段,该项的值;
      

  3.   

    DropDownList1.DataSource = 你的数据集
    DropDownList1.DataTextField=显示的列
    DropDownList1.DataValueField= 取得值的列
      

  4.   

    http://apps.hi.baidu.com/share/detail/24618273
      

  5.   

    楼上说的很全面。
    Value就是键  Text是值
      

  6.   

    DropDownList1..DataTextField="";//数据库中选择出的字段,要显示的文本;
    DropDownList1.DataValueField="";//数据库中选择出的字段,该项的值; 先要前面为下拉列表指定数据来源```
      

  7.   

       /// <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%
            }
      

  8.   


    DropDownList1.DataTextField="key";
    DropDownList1.DataValueField= "value";正确答案!