I've got the following code for clearing the selections and resetting the WebDropDown server side:
foreach (Infragistics.Web.UI.ListControls.DropDownItem item in WebDropDown1.Items) { if (item.Selected) { item.Selected = false; } }
this.WebDropDown1.CurrentValue = "Please select...";
This works, although is very complex considering there should be an easy way to do this... i.e. WebDropDown1.SelectedIndex = -1 like a normal WinForm control. Even WebDropDown1.SelectedItems.Clear() would be better.
I'm now trying to do the same thing Client-Side. This is the code I have that doesn't work:
function Reset() { var dropDown = $find('<%=WebDropDown1.ClientID %>'); var selectedList = dropDown.get_selectedItems(); for (var i = 0; i< selectedList.length; i++) { selectedList[i].set_selected(false); } dropDown.set_currentValue("Please select...", false); }
How can this be done client-side?
Thanks, that worked on the ClientSide. That method definately is not on the WebDropDown. I am using release 2067.
Hi Will,
Yep, appears that this code was merged to Release a day after July's hotfix went out. I.e. it will be in the August one, which will be out in 1-2 weeks.
Thanks,
Angel