怎么把上一页中在dropdownlist中得到的值绑定在当前页dropdownlist中显示的位置排在第一个 

解决方案 »

  1.   

    如果是循环 集合用add方法添加的话。就不行啦。如果直接用datasource指定数据源就会默认显示数据第一项的。
    adapter.fill(dataset);
    dropdownlist.datasource=dataset.Tables[0];
    dropdownlist.DataTextField="Name";
    dropdownlist.DataValueField="ID";
    dropdownlist.DataBind();
    大概就这几步
      

  2.   

    我在前一页中已经选过的,比如在前一页中ddl 下拉有5个供你选择,我选了第三个,我现在要把第三那个的值在当前页面中显示位置排在第一个,其他没有选中的值排在后面
      

  3.   

    例如上一页得到值string st;
    则加到DropDownList的最前面是:
    DropDownList1.Items.Insert(0, st);
    //后面绑定DropDownList1的其它值,
    一般在前面要清空一下:
    DropDownList1.Items.Clear();