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

How can I bind sub grid's datasource which is from main grid's in Editor Template

1 Answer 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Cheng-Chang
Top achievements
Rank 1
Cheng-Chang asked on 28 Aug 2018, 09:39 AM

Grid data source is as follow:

public class Customer

{

    public string customer_id { get; set; } = "";

    public string customer_name { get; set; } = "";

    public List<Order> Orders { get; set; } = "";

    public List<Delivery> Delivery{ get; set; } = "";

}

public class Order

{

    public string order_id { get; set; } = "";

}

 

public class Delivery
{
    public string delivery_id { get; set; } = "";
}

 

My design:

Master grid will present Customer record(List<Customer>), and when I click edit button, it will pop up a edit template

and edit template will include Customer's data and two sub grids(Order, Delivery). 

 

My question is I know if I want to get string, it would be "#=customer_id#" but I don't know if I want to get List -- Order and Delivery -- to bind sub grids data source, how can I do.

Does anyone help me?

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 30 Aug 2018, 08:11 AM
Hi,

Based on the description it looks like the Grid can show the data in a hierarchical structure. I would suggest specifying a detail Grids that would show the relevant orders and deliveries for a customer. 

Check out the example below that illustrates how a hierarchy can be configured for the Grid.



Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Cheng-Chang
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or