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

Hierachial Databinding to Entities

2 Answers 92 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Abhilash
Top achievements
Rank 1
Abhilash asked on 06 Jul 2010, 12:24 PM
Hi,

Does the Winform Telerik Grid Supports displaying hierachial data from object collection.

I can give you a simple example in our application we have a Customer class which has Firstname and Surname and a List of Address details. The Address is a separate class which have properties like Town,Postcode and all

Customer
{
    string FirstName;
    string Surname;
    List<Address> Addresses;
}

the requirement is to display the customer forename and surname only in the main row and the list of address in the child table.

Does the winform grid supports displaying the above scenario?

2 Answers, 1 is accepted

Sort by
0
Abhilash
Top achievements
Rank 1
answered on 07 Jul 2010, 06:41 AM

Hi Just illustrating my question a bit more here.:

Here is my Customer class structure

Class Customer

{

            Public string CustomerId {get;set;}

           

            Public string ForeName{get;set;}

            Public string SurName{get;set;}

            Public IList<Address> CustomerAddress {get;set;}

           

}

Here is my AddressClass

Class Address

{

            Public AddressType Type {Get;set;}

            Public string City {get;set;}

            ..

}

In my database i have the following structure for the Customer and Address Tables

Customer Id (Primary Key)

Fore Name

Sur Name

100

Test Forename

Test Surname

AddressId (Primary Key)

Customer Id (Foreign Key)

Type

City

Town

Postcode

200

100

Business

Test city1

Test town 1

Test postcode1

201

100

Personal

Test city2

Test town 2

Test postcode2

202

100

Other

Test city3

Test town 3

Test postcode3

We are not using Dataset in the application.

So we have a DAL where we will form the Customer object from these 2 tables.

Now coming to the UI we will have to display the Customer Forename and Customer Surname in the main row of the Gridview and the Address Details as the Child Template.

Can you please share your thoughts how we can use the Binding source control for this purpose.

0
Julian Benkov
Telerik team
answered on 14 Jul 2010, 02:35 PM
Hi Abhilash,

This hierarchy mode was not supported by the RadGridView control. The Q2 2010 version of grid control (released today) adds this functionality (object-relation hierarchy mode), however the feature will be completed after the Q2 2010 release. In Q2 2010 you can use relation hierarchy mode and set DataSource of MasterTemplate to Customer list and DataSource of child template to list of Address objects.

Best wishes,
Julian Benkov
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
Tags
GridView
Asked by
Abhilash
Top achievements
Rank 1
Answers by
Abhilash
Top achievements
Rank 1
Julian Benkov
Telerik team
Share this question
or