Hi,
I am using Ig combo with multi select option with checkboxes in ASP.NET MVC
@(Html.Infragistics()
.Combo()
.ID("Ids")
.MultiSelectionSettings(s => { s.ShowCheckBoxes(true); s.Enabled(true); })
.DataSource(@ViewBag.Ids.Items)
.TextKey("Description")
.ValueKey("ID")
.Width("280px")
.Render())
Then binding the onChange event like this:
$("#Ids").bind("igcomboselectionchanging", OnIdsSelected);
function OnIdsSelected(evt, ui) {
if(ui.items[0].data.ID == -1)
{
//Select all checkboxes
}
I am not sure how to select all the remaining checkboxes in the combo box when the first item is selected.
I tried $("#Ids").igCombo("Items") but this doesn't give me all the items
Can someone please suggest the correct syntax for this?
Regards
Singh
Hello Singh,
Thank you for contacting Infragistics Developer Support!
In your case you can use the selectAll method of the combo i.e
However you would have to cancel the selectionChanging event. A better approach is to use a header template where you can place a button/checkbox/etc and call the selectAll method through the igCombo API.
For more information check: this and this and a sample showing off the header template feature