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

Parent-Child view implementation

9 Answers 248 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Phi
Top achievements
Rank 1
Phi asked on 02 Jul 2007, 03:32 AM

Hi,

I want to know how to implement a parent-child scenario in a GridView. I have a datasource which contains the "parent" rows, and for each parent row, I want to be able to "expand" and see another gridview which contains the child rows.

Parent and child tables do not have the same columns, and my datasource is a collection of objects.

Couldnt' find an example of this in the included samples.

Regards,
Phi Le

9 Answers, 1 is accepted

Sort by
0
rbell
Top achievements
Rank 1
answered on 02 Jul 2007, 07:09 PM
I to am having to implement this same structure and although the documentation hints that this truely is a capability of the GridView for WinForms (http://www.telerik.com/help/WinForms/Q1_2007/grdStructureOverview.htm - scroll to description of MasterTableView), I am unable to locate any examples, nor am I able to get it to recognise any relationships in the dataset.

Can anyone help us with this?

Randy
0
Mike
Telerik team
answered on 03 Jul 2007, 03:15 PM
Hi guys.

Even though the object-structure of RadGridView is designed to handle master-detail scenarios, this functionality is still not present in the current version of the product. We are working on it and it is expected no later than the Q2 release.

In the meanwhile, it would be very great if you share your ideas on how you would like to see this feature implemented in RadGridView.

 
Regards,
Mike
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
rbell
Top achievements
Rank 1
answered on 03 Jul 2007, 04:58 PM
Thanks Mike for your update.   I will leave the "How" to you guys...your already good at that ;-) .  However, I can share some wishes on some specific functionality I'd like to see:

As far as visual representation, I'd like to see the details for each parent by expanding the details (children) - similar to expanding the groups and similar to what is presented in the documentation link I gave in my earlier post.

I'd like to see the GridView be able to present the hierarchy views for not only datasets where relations are defined, but also business objects where children are represented as public properties that return objects that implement IEnumerable.  Other DataGrids I have seen display hierarchies only on datasets and you could go a long way by also presenting hierarchical data for business objects.  This should should be easily accomplished by utilizing reflection upon the bound data type.

I look forward to seeing what you come up with!  I really like the look and feel of RadControls for WinForms so far.  I realize its still in its child hood and has some functionality to be still built out, but its quite impressive for such a young product!

Randy
0
Phi
Top achievements
Rank 1
answered on 03 Jul 2007, 11:08 PM

Further to Randy's excellent suggestions, I have used other GridView components that take it one step further, and allow the "child" view to be any datasource unrelated to the parent. They do this by letting you subscribe to something like an "OnParentRowDataBound" event, where you can specify if

  • That particular parent row has a child view or not
  • The child view data source for that parent row

Of course this would only be an extra option for flexibility. For basic scenarios, you should just specify the child as being an IList/IEnumerable property of the parent, then the GridView should take care of the rest.

Cheers
Phi

0
Mike
Telerik team
answered on 04 Jul 2007, 04:40 PM
Thank you for the elaborations, guys. We  are glad that we share the vision of how grid hierarchy should behave for best usability and effectiveness. Your wishes are logged in our to-do list and hopefully they will be present in Q2. Keep us updated in case you come up with any other ideas.
 

Kind regards,
Mike
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Emanuele Savarese
Top achievements
Rank 1
answered on 06 Jul 2007, 01:12 PM
It's possible get Q2 beta with hierarchy functions?
0
Vassil Petev
Telerik team
answered on 06 Jul 2007, 01:31 PM
Sure Arcangelo, we have logged your name in our beta test program. We will notify you by email once we have the beta out.

If anyone else wants to participate in the beta program, please post here. We do not have any restrictions and we award Telerik points to all who participate!


Greetings,
Rob
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Phi
Top achievements
Rank 1
answered on 06 Jul 2007, 01:53 PM
Hi Rob,

I'd definitely like to take part in the beta program to test Parent-Child view functionality in the GridView.

Cheers
Phi
0
Vassil Petev
Telerik team
answered on 06 Jul 2007, 02:12 PM
Thank you for the interest in the beta, Phi, you have been subscribed to the program.


Sincerely yours,
Rob
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Phi
Top achievements
Rank 1
Answers by
rbell
Top achievements
Rank 1
Mike
Telerik team
Phi
Top achievements
Rank 1
Emanuele Savarese
Top achievements
Rank 1
Vassil Petev
Telerik team
Share this question
or