i use the RadTabControl like your DataBinding-Example. This works great, but how do i add a New Tab on Page_Load?
Second Problem, how to load the Content now and not after selecting the tab?
Thanks a lot
1 Answer, 1 is accepted
Pavel R. Pavlov
answered on 22 Oct 2013, 08:00 AM
Since you use data binding you need to update the ItemsSource collection of the RadTabControl in order to add item to the control. Please note that the collection must invoke the CollectionChanged event whenever it has been changed. By doing so your ViewModel will notify the UI that the ItemsSource of the control has been changed and the RadTabControl will add/remove the item. The best way to do this is to use ObservableCollection<T>. This native collection implements the event out of the box and it is suitable for data binding scenarios.
Regarding your second question - please note that the RadTabControl is designed to load the content of the selected item, only. In other words this is the designed and the expected behavior of the control. However, there may be a better approach in your particular scenario. And I could be able to help you on your way, but I will need you to elaborate more on your requirements. Could you please clarify what you have in mind when you say "now"? Do you mean the Loaded event of the page?
Thank you for your cooperation.
Pavel R. Pavlov
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely. Sign up for Free application insights >>