Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / How to show selected value(default value) using IgniteUI Combobox in Angular

How to show selected value(default value) using IgniteUI Combobox in Angular

New Discussion
Shailesh Bhat
Shailesh Bhat asked on Jan 11, 2019 9:02 AM

I need to show the selected value while loading the page. How it is possible using your angular control. For ex. I have combobox to select language. Out of combobox options, while loading the page I need to show one language by default.

Sign In to post a reply

Replies

  • 0
    Milko Venkov
    Milko Venkov answered on Jan 7, 2019 11:25 AM

    Hello Shailesh,

    The value of the igxCombo actually represents a list of the combo’s selected items. If you need to set the value to equal particular value of your data you need to add this item to the selected items. Nice place to do this is in AfterViewInit event of your component, where igxCombo is placed. You may use code like this:

    ngAfterViewInit(): void {
        this.igxCombo.selectItems([this.items[0]]);
    }

    Please let me know if any additional questions on this matter arise.

    • 0
      Shailesh Bhat
      Shailesh Bhat answered on Jan 11, 2019 6:08 AM

      Thank you..Similar feature I need in Radiogroup also..Can you please

      • 0
        Milko Venkov
        Milko Venkov answered on Jan 11, 2019 9:02 AM

        Hi Shailesh,

        The value of the radio group through ngModel two way binding. You can use markup like this:

        
         
          {{item}}
         
        

        Do not forget to set selectedItem property in code behind like this:

        public selectedItem = this.items[itmeIndex];

        More information about igxSelectGroup you may find in our online samples here “Radio & Radio Group”.

        Please let me know if this answers your question.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Shailesh Bhat
Favorites
0
Replies
3
Created On
Jan 11, 2019
Last Post
7 years, 1 month ago

Suggested Discussions

Created by

Created on

Jan 11, 2019 9:02 AM

Last activity on

Feb 20, 2026 11:40 AM