Basic hierarchies is not working in Gridview telerik silverlight

6 posts, 0 answers
  1. Balsuyambu
    Balsuyambu avatar
    2 posts
    Member since:
    Aug 2010

    Posted 20 Aug 2010 Link to this post

    Hi

    Basic hierarchies is not working in server side with latest telerik version 2010 SP1 and it is working in 2009 SP2 in Gridview telerik silverlight control.

    Note : User will set the datasource at runtime and object/class may vary from time to time.

    Thanks
    Balsuyambu S.

  2. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 20 Aug 2010 Link to this post

    Hello Balsuyambu,

    We would really appreciate it if you could give us more information about your scenario so that we can try to replicated on our site. For example, that is the structure of the data, how is the grid configured, etc. 


    Sincerely yours,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Balsuyambu
    Balsuyambu avatar
    2 posts
    Member since:
    Aug 2010

    Posted 20 Aug 2010 Link to this post

    Hi Mila,

    Thanks for your quick reply

    Please find below the XAML Code

     

     

    <Grid x:Name="LayoutRoot" Background="White">

     

     

     

    <MyGrid:RadGridView Name="patternGrid" >

     

     

     

    <MyGrid:RadGridView.HierarchyChildTemplate>

     

     

     

    <DataTemplate>

     

     

     

    <MyGrid:RadGridView Name="stylesGrid" ShowGroupPanel="False" >

     

     

     

    <MyGrid:RadGridView.HierarchyChildTemplate>

     

     

     

    <DataTemplate>

     

     

     

    <MyGrid:RadGridView Name="attributesGrid" ShowGroupPanel="False" >

     

     

     

    </MyGrid:RadGridView>

     

     

     

    </DataTemplate>

     

     

     

    </MyGrid:RadGridView.HierarchyChildTemplate>

     

     

     

    </MyGrid:RadGridView>

     

     

     

    </DataTemplate>

     

     

     

    </MyGrid:RadGridView.HierarchyChildTemplate>

     

     

     

    </MyGrid:RadGridView>

    XAMS.cs code

     

     

     

     

     

    public MainPage()

     

    {

    InitializeComponent();

    GridViewTableDefinition d = new GridViewTableDefinition();

     

    d.Relation =

    new PropertyRelation("Orders");

     

     

    this.patternGrid.ChildTableDefinitions.Add(d);

     

     

    this.BuildCustomers();

     

     

     

     

    }

     

    private void BuildCustomers()

     

    {

     

    this.customers = new ObservableCollection<Customer>();

     

     

    var orders = new ObservableCollection<Order>();

     

     

    for (int i = 0; i < 10; i++)

     

    {

    orders.Add(

    new Order { CustNumber = i, Number = i, Details = "Order" + i });

     

    }

     

    for (int i = 0; i < 20; i++)

     

    {

    customers.Add(

    new Customer { Email = "Mail" + i, Name = "Name" + i, Number = i, Orders = orders });

     

    }

     

    this.patternGrid.ItemsSource = customers;

     

    }

    We have done the POC based on below URL

    http://www.telerik.com/help/silverlight/gridview-basic-hierarchies.html

    Note : className of ("Customer" and "Order") may vary and it depends on run time.

    Kindly validate

    Thanks
    Balsuyambu S.

  5. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 23 Aug 2010 Link to this post

    Hi Balsuyambu,

    The setup is a bit different when using HierarchyChildTemplate. For your scenario you should first define a dummy TableDefinition like so:

    <telerik:RadGridView.ChildTableDefinitions>
                  <telerik:GridViewTableDefinition />
              </telerik:RadGridView.ChildTableDefinitions>

    And finally you should bind the ItemsSource property of the details grid to the details data - in your case that is the Orders property:

    <telerik:RadGridView.HierarchyChildTemplate>
        <DataTemplate>
            <telerik:RadGridView ItemsSource="{Binding Orders}">
      
            </telerik:RadGridView>
        </DataTemplate>
    </telerik:RadGridView.HierarchyChildTemplate>


    Sincerely yours,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Dave Navarro
    Dave Navarro avatar
    150 posts
    Member since:
    Jul 2005

    Posted 19 Dec 2011 Link to this post

    Hello,

    I'm trying to setup some Basic Hierarchies like the ones described here but want to know if this code is still the current solution now that we're using Q3 2011 builds.

    Please let me know and thanks!

    ~ Dave
  7. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 19 Dec 2011 Link to this post

    Hi Dave Navarro,

    The approach for defining hierarchical grid and the corresponding child table definitions has not been changed so far. Please take a look at our online documentation and demos for additional reference and let us know if you need any assistance.
     

    Best wishes,
    Maya
    the Telerik team

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

Back to Top
DevCraft banner