Hi guys,
I've searched the forums and can't find any information on this, but I suspect its a common enough question.. (csla 2.x, vb.net 2005)
I have a datagridview, in which I would like to display a view of parent-child data. In essence, customers and orders - I need some "drill-down" capability in this app. .. Now I know that you can do this using datatables/views etc, but I'm at a loss as to how I do this with csla-businessclass data.
I have defined my business classes and I can happily display the parent rows, but there appears to be no inner-workings in the datagridview that recognize the childclasses of businessbase class.
The views need only be readonly.
Do I have to somehow create a dataview/table from my csla-objects and build relationships? If so, any pointers on how I do that?
Thanks in advance.
g.
If you set up your objects like:
Parent
-> ChildList
-> Child
-> GrandChildList
-> GrandChild
and then use data binding by putting two grids on your form (one for ChildList, one for GrandChildList), data binding should automatically handle the drill-down for you. In other words, as you select a Child in the first grid, the appropriate GrandChildList should be displayed in the second grid.
The reason this works is that the bindingsource objects created by data binding automatically understand the parent-child relationships between the objects. To get this to work (at least easily) you should drag-and-drop the classes onto your form from the Data Sources window - Visual Studio will do all the hard work.
Hi Rocky,
Thanks for the reply.
I probably wasn't too clear in my initial (rushed) post.
What you describe I have achieved, but the behaviour I am trying to reproduce is within a single datagrid/datagridview.
With datasets/views, et al, in VS.net came this cool ability to create relations between a parent dataset and a child dataset and have them handled within the single grid control. The grid automatically displays the 'expando' icon, which when clicked 'drills-down' and displays the child rows directly beneath the parent row.
As the grid is probably geared toward those relations being in place (feel free to prove me wrong :) ) - is there a 'simple' way to build a generic dataview type from say a CSLA sortedbindinglist?
Thanks again,
Graham
From: gajit [mailto:cslanet@lhotka.net]
Sent: Wednesday, September 13, 2006 11:54 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] DataGridView - Parent Child rowsHi Rocky,
Thanks for the reply.
I probably wasn't too clear in my initial (rushed) post.
What you describe I have achieved, but the behaviour I am trying to reproduce is within a single datagrid/datagridview.
With datasets/views, et al, in VS.net came this cool ability to create relations between a parent dataset and a child dataset and have them handled within the single grid control. The grid automatically displays the 'expando' icon, which when clicked 'drills-down' and displays the child rows directly beneath the parent row.
As the grid is probably geared toward those relations being in place (feel free to prove me wrong :) ) - is there a 'simple' way to build a generic dataview type from say a CSLA sortedbindinglist?
Thanks again,
Graham
Well, I learn something new everyday - I was unaware of this. There go my promises of a new fan-dangled-bells-and-whistles laden module... :)
Thanks for your help Rocky.
Hi Ross,
Thanks.
Have you successfuly used this with CSLA hierarchy?
Graham
gajit:
Have you successfuly used this with CSLA hierarchy?
Copyright (c) Marimer LLC