Hello,
I am using a webDropDown w/ MultipleSelectionType = Checkbox. Is it possible to access a list of selected values for the list of selected items? I see this question was asked but it was over 7 years ago.
I'm using version 19.1 of the controls.
As easy as:
protected void WebDropDown1_SelectionChanged(object sender, Infragistics.Web.UI.ListControls.DropDownSelectionChangedEventArgs e) { DropDownItem[] selectedItems = (DropDownItem[])e.NewSelection; var listOfValues = new List<string>();
foreach (DropDownItem item in selectedItems) { listOfValues.Add(item.Value); } }
>> access a list of selected values
I have the selected items. I want their selected values.
WebDropDown1.Selectedvalue <<< I want the list of values (plural)
Hi Stewart,
You can get the collection of selected items from the event arguments in the SelectionChanged event:
protected void WebDropDown1_SelectionChanged(object sender, Infragistics.Web.UI.ListControls.DropDownSelectionChangedEventArgs e) { DropDownItem[] selectedItems = (DropDownItem[])e.NewSelection; }
Please let me know if you have further questions.