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.
Hi Shailesh,
The value of the radio group through ngModel two way binding. You can use markup like this:
<igx-radio-group name="myRadioGroup" [(ngModel)]="selectedItem"> <igx-radio *ngFor="let item of items" value="{{item}}"> {{item}} </igx-radio> </igx-radio-group>
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.
Thank you..Similar feature I need in Radiogroup also..Can you please
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.