dropdownlist属性(DropDownList的常用属性和事件)
一、如何设置DropDownList的值被选中
设置数据表选中的值:dropdowslist.selectedIndex=-1dropdownlist.Items.findbyvalue(你的值).selected=true或dropdownlist.Items.findbytext(你的值).selected=trueforexample:drop1.Items.FindByValue("5").Selected=true;drop1.Items.FindByText("hello").Selected=true;
二、dropdownlist的使用方法
dropdownlist使用方法绑定数据后,设置该DropDownList的SelectedValue属性即可。
比如DropDownList1.SelectedValue=“商品类别1”//这个换成你原来商品所属类型就可以了。