Bind the ListItem in ArrayList to DropDownList

xiaoxiao2021-03-05  22

DropDownListDisplay (ArrayList Input, Dropdownlist Inputddl, String Comparevalue)

{

For (int i = 0; i

{

ListItem AITEM = IITEM = IIT [I] as listitem;

Inputddl.Items.Add (AITEM);

}

IF (CompareValue! = ") Inputddl.selectedIndex = Inputddl.indexof (Inputddl.Items.FindByVlue);

}

Parameters: ArrayList, data that needs to be bound

DropDownList, bound drop-down list

CompareValue, a String type comparison parameter, used to set the drop-down list initial option

转载请注明原文地址:https://www.9cbs.com/read-38662.html

New Post(0)