RadTabControl with RadGridview as TabItem and complex collections

2 posts, 0 answers
  1. Masha
    Masha avatar
    5 posts
    Member since:
    Apr 2010

    Posted 27 Jul 2011 Link to this post

    Hello,

    I'm trying to implement the following:

    <telerik:RadTabControl
               x:Name="Stage"
               ItemsSource="{Binding DistributionList}"
               DisplayMemberPath="Name"
               TabStripPlacement="Left"
               TabOrientation="Horizontal">
     
               <telerik:RadTabItem>
                   <telerik:RadGridView
                       Name="Recipients"
                       ItemsSource="{Binding Recipients}">
     
                             .........
     
                           </telerik:RadGridView>
               </telerik:RadTabItem>
     
           </telerik:RadTabControl>

    I have a collection of "DistributionLists" in the view model. Each item in this collection has a child collection "Recipients". I would like to show the Recipients in a GridView inside the TabItem of the TabControl but this doesn't seem to work. I'm not even getting the grid on the tab.

    Thanks in advance.
  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 01 Aug 2011 Link to this post

    Hi Masha,

    In the code you pasted I see that you're populating the TabControl both through its ItemsSource and Items collection (adding a TabItem declaratively). This approach is not valid. You have to use either ItemsSource or Items but not both. I've modified you're code to demonstrated what I have in mind. Please take a look at the attached project and let me know if you have further questions.

    All the best,
    Kiril Stanoev
    the Telerik team

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

  3. DevCraft banner
Back to Top