How can i select all the items in a webdropdown with server side code ?
I was just wondering did you have a chance to try my suggestion. If you still need any assistance on the matter, please do not hesitate to ask.
Hello gamerschlag,
Thank you for posting in our community!
It is possible to select all of the items from a WebDropDown ServerSide via the following code:
“Assuming there is a WebDropDown3 already created.”
protected void Page_Load(object sender, EventArgs e)
{
#region Select all items ServerSide
Infragistics.Web.UI.ListControls.WebDropDown WDD3 = (WebDropDown)FindControl("WebDropDown3");
DropDownItemCollection Items = WDD3.Items;
WDD3.EnableMultipleSelection = true;
foreach (DropDownItem item in Items) { item.Selected = true;
} //Check selected Items List<DropDownItem> AllSelected = WDD3.SelectedItems;
#endregion
}