首页互联网dropdownlist属性(DropDownList的常用属性和事件)

dropdownlist属性(DropDownList的常用属性和事件)

编程之家2024-01-25176次浏览

一、如何设置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的使用方法

dropdownlist使用方法绑定数据后,设置该DropDownList的SelectedValue属性即可。

比如DropDownList1.SelectedValue=“商品类别1”//这个换成你原来商品所属类型就可以了。

dropdownlist属性(DropDownList的常用属性和事件)
qq皮肤代码(免费QQ空间皮肤代码及使用方法)云服务器代理(云服务器怎么搭建ip代理)