Add TabItem on Page_Load?

2 posts, 0 answers
  1. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 17 Oct 2013 Link to this post


    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
    Best Regards
  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1167 posts

    Posted 22 Oct 2013 Link to this post

    Hello Rene,

    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
    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 >>
  3. DevCraft banner
Back to Top