Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / How to add "Select All" selection for Igx ComboBox

How to add "Select All" selection for Igx ComboBox

New Discussion
Afif Halim
Afif Halim asked on Feb 22, 2022 7:16 AM

Hi,

Is there a way to add the “Select All” button to the IgxCombo selection?

For example, adding below of the search input

Any help will be highly appreciated.

Thanks.

Regards,

Afif

Sign In to post a reply

Replies

  • 0
    Viktor Kombov
    Viktor Kombov answered on Feb 21, 2022 5:37 PM

    Hello Afif,

    Thank you for posting in our community.

    What I can suggest for achieving your requirement is using the Header template of igxCombo where you can add your custom content:

    HTML:

      
    
    Select All

     

    TYPESCRIPT:

    export class ComboSelectAllButtonComponent { 
      @ViewChild('combo') public combo!: IgxComboComponent;
    
      public onSelectAllClick() {
        if (this.combo.selection.length === this.combo.data?.length) {
          this.combo.deselectAllItems();
        } else {
          this.combo.selectAllItems();
        }
      }
    }

    Attached you will find a small sample where is demonstrated how the suggested approach is working.

    Please test the sample on your side and let me know whether you find it helpful.

    Looking forward to hearing from you.

    Regards,
    Viktor Kombov
    Entry Level Software Developer
    Infragistics, Inc.

    IgxComboSelectAllCheckBox.zip

    • 0
      Afif Halim
      Afif Halim answered on Feb 22, 2022 2:54 AM

      Hi Viktor,

      Thanks for your wonderful solution, I'm able to implement the changes successfully.

      However, one note from my end, I'm using this.combo.selectedItems() instead of this.combo.selection to make it works, probably because I'm using the older version (v11).

      Thanks!

      Regards,
      Afif

      • 0
        Viktor Kombov
        Viktor Kombov answered on Feb 22, 2022 7:16 AM

        Hello Afif,

        I am glad that you find this suggestion helpful!

        Thank you for choosing Infragistics components!

        Regards
        Viktor Kombov
        Entry Level Software Developer
        Infragistics, Inc.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Afif Halim
Favorites
0
Replies
3
Created On
Feb 22, 2022
Last Post
4 years, 7 months ago

Suggested Discussions

Created by

Created on

Feb 22, 2022 7:16 AM

Last activity on

Feb 24, 2026 9:57 AM