Replies
Hello Ivan,
it seems that only works if the click is initiated from ASP.NET, rather than JS.
If I call your showItems() from the Web Inspector, the text gets cleared, not updated.
Regards
Hello Ivan,
thanks for your quick response!
[quote user=”E49D81867DA846E3D1A1C7490AFA25AC697E0254″][/quote]
For your first issue, I have tested it out on version 21.1. and version 20.2 and there was no issue with opening the WebDropDown. Regarding it I have 2 questions:
Which version of Infragistics Controls are you using?
Oh, I should've mentioned that. This was with 20.1.
I upgraded to 21.1, and that issue seems to be gone, so never mind. 🙂
[quote user=”E49D81867DA846E3D1A1C7490AFA25AC697E0254″]How are you assigning the data source for the WebDropDown and how big is this data source? If the data is enormous, it might cause the control to load slowly.[/quote]
It's an array of strings (originally from a database query), but there are only about 30 items, so I don't think that was the reason. The items get added as follows:
foreach (var item in data)
{
MyDropDown.Items.Add(new Infragistics.Web.UI.ListControls.DropDownItem(item));
}
But, in any case, I can no longer reproduce that behavior in 21.1.
[quote user=”E49D81867DA846E3D1A1C7490AFA25AC697E0254″]For your second issue, as you predicted there is a property called “EnableClosingDropDownOnSelect” simply setting it to false would allow you to select multiple items, without closing the WebDropDown.[/quote]
Yes! Perfect.
[quote user=”E49D81867DA846E3D1A1C7490AFA25AC697E0254″][/quote]
As for the last issue, I have created a small sample application, where I modify the selected items of the WebDropDown inside a button click event, where the selected items are checked inside the dropdown list and are also present in the text portion of the WebDropDown, so this again may be related to using an older version.
Please test it on your side and let me know if this is an accurate demonstration of what you are trying to achieve.
Yes and no. For the case where I just want to clear the selection, that works.
However, this web site has various presets of selections stored in the user database. There's a dropdown where a user can select a predefined preset. If I do that, the checkboxes get ticked, but the "text field" portion of the dropdown is now always empty (which seems to be what your code does).
So, let's say the drop-down currently has A and B ticked. The text field will say "A,B". Now the user selects a different presets, which will programmatically change the actual ticked checkboxes to "C,D". With your code, the text field will now just be an empty string; it should be "C,D".
What I was hoping for is a way to set the text based on the selection. I could presumably do this manually with a string.Join() in JS, but I'm guessing your control already has some internal method like that that does this?
Thanks,
Sören