Please refer to your official sample/demo page: https://es.infragistics.com/samples/aspnet/drop-down/multi-selection
Is this by design? What is the point of allowing selection using checkboxes if there is no reliable way to access them using the selecteditems array?
Is there any way to get the list of items that are currently checked?
I am not using the edit control part of the drop down. I have disabled it by setting the DisplayMode to DropDownList and with "eventArgs.set_cancel(true);" in the ValueChanging client-side event.
I have a separate label on the page where I display a comma delimited list of the currently selected items using the following client-side function triggered on SelectionChanged:
function onSelectedIndexChanged(sender, eventArgs) { var Items = eventArgs.getNewSelection();
var ItemsString = ""; var Delimiter = "";
if (Items.length > 1) Delimiter = ", ";
for (i = 0; i < Items.length; i++) { ItemsString += Items[i].get_text(); if (i < (Items.length - 1)) ItemsString += Delimiter; }
$get("<%=selLabel.ClientID%>").innerHTML = ItemsString;}
Just as in your demo, this only works as long as the user uses their mouse to check and uncheck the items' checkboxes. The moment they use the keyboard to navigate through the list, it breaks.
To reiterate, is there any way I can get a list of items that are checked?
If not, is there any way I can disable navigating through the list using the keyboard? Using "eventArgs.set_cancel(true);" for the InputKeyUp and InputKeyDown events does not help. Any other thoughts?
Thanks.
Hi,
You can find the attached sample, as promised. Please let me know if you need something else. The issue I have submitted (to fix this behavior officially) is : 19915.
I will be fixing this shortly as well.
P.S: In the attached sample you will need to add ig_res (for the styles)
Thanks,
Angel
Hi Angel,
Quick follow up.
I included the selectionChanging and valueChanging functions in my application and it works as desired!!! Thanks very much! I really appreciate your prompt assistance. The sample web site code was very timely and very easy to re-use. Thanks again!
The only bit of functionality that I would like to add is in the selectionChanging function - the user should be able to navigate through the list using the keyboard navigation keys (this works perfectly now) and check or uncheck the checkboxes using the spacebar (needs to be added). I am not sure if this is just a simple addition to the selectionChanging function or, if it is more complex and needs to be added to the official fix.