access children

access children

Old forum URL: forums.lhotka.net/forums/t/1737.aspx


Wal972 posted on Friday, November 10, 2006

Hi

I have  a PayRun Collection which contain Pays with a Summary. Now how can I access a property TotalGross in the PaySummary from a Gridview which is set to the Pays Level. I can see the Summary as a field but not the individual propertys

Help

Ellie

Bayu replied on Saturday, November 11, 2006

The WinForms gridview is not capable of showing hierarchies of data. Personally I use Infragistics' Grid which can show an arbitrary number of 'bands' of data.

With standdard WinForms controls I guess that the following are your options:
- master-detail view setup, you will have some view on the sideline that tracks the currently selected row in your master grid and displays additional details like the TotalGross. (ugly, I know)
- you take care of databinding manually, then you can wire your object-properties to individual columns programmatically (nasty, cumbersome, .... )
- use a treeview (does not support databinding, so it's a variation of the previous option, nasty again)
- create additional properties on your Pays BO that wrap the properties on your TotalGross child object (also ugly, but at least you can leave regular databinding in place)

In the past I used the regular winforms grid like everybody else .... but after a year of frustration I bought the Infragistics NetAdvantage kit (comes at a price slightly under thousand dollars I believe). As a result I haven't been using the WinForms grid control for quite a while now. I do believe that the options I listed are the ones available to you, but I may be incomplete.

Given the high degree of undesirability in my suggestions I surely hope someone will pop a more elegant solution.

Good luck,
Bayu

Wal972 replied on Saturday, November 11, 2006

How about with ASP.Net any suggestions ?

Copyright (c) Marimer LLC