Skip to content

Infragistics Community Forum / Web / Ignite UI for jQuery / Ig Combo box – Multi select – Select All

Ig Combo box – Multi select – Select All

New Discussion
Singh
Singh asked on Jul 11, 2017 4:10 PM

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

Sign In to post a reply

Replies

  • 0
    Radoslav Karaivanov
    Radoslav Karaivanov answered on Jul 11, 2017 4:10 PM

    Hello Singh,

    Thank you for contacting Infragistics Developer Support!

    In your case you can use the selectAll method of the combo i.e

    $("#checkboxSelectCombo").bind("igcomboselectionchanging", function(evt, ui) {
      if (!ui.currentItems && ui.items && ui.items[0].data.ID === -1) {
         ui.owner.selectAll();
         return false;
       }
    });

    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

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Singh
Favorites
0
Replies
1
Created On
Jul 11, 2017
Last Post
8 years, 7 months ago

Suggested Discussions

Created by

Created on

Jul 11, 2017 4:10 PM

Last activity on

Feb 24, 2026 10:12 AM