例如:網格中的dropdownlist值是:1, 2, 3
現在再數據庫中讀取一個值是1怎么樣讓dropdownlist再網格中顯示該值。

解决方案 »

  1.   

    DropDownList1.SelectedValue = 1;
      

  2.   

    ListItem item = DropDownList1.Items.FindByText("1");
                if (item != null)
                {
                    DDLSubSales.ClearSelection();
                    item.Selected = true;
                    DDLSubSales.Enabled = false; 
                }原来DropDownList1里就有1,2,3三个值
    在DropDownList1里显示你读出来的值,相当与只是将1这个值在DropDownList1里选中就行了``