This is a migrated thread and some comments may be shown as answers.

First tab selected when binding async

1 Answer 37 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Gabriel
Top achievements
Rank 1
Gabriel asked on 31 Oct 2011, 09:05 PM
I have a situation where I bind my tabs through a MVVM patterns. The binding source is loaded async AFTER the TabControl is loaded. The tabs are loading correctly but I want the first tab to be selected when I got at least one tab in the TabControl or when I finish loaded.

My current workaround is to have SelectedIndex (int) in my binded View-Model set to 1 and bind it to the SelectedIndex in the TabControl. Is there any other way of doing it more clean? Perhaps adding a property that force at least one tab to selected?

Thanks

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 03 Nov 2011, 04:45 PM
Hi Gabriel,

 I don't think binding the SelectedIndex property is not clean. However, you can introduce Selected boolean property in the ViewModels that the RadTabItems will bind to. Then just bind the RadTabItem.IsSelected to the Selected property via ContainerBindings. Please let us know if you need assistance on this. 

Regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TabControl
Asked by
Gabriel
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or