Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
How to show selected value(default value) using IgniteUI Combobox in Angular
posted

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.

Parents
  • 21795
    Verified Answer
    Offline posted

    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.

Reply Children