Typed Lists Master-detail grids

Posts   
 
    
zaad
User
Posts: 19
Joined: 13-Sep-2005
# Posted on: 14-Oct-2005 20:36:08   

Hello,

I want to use typed lists for displaying read-only data in two grids which are master-detail related. How should I do that? Do I have to create one typed list for master and one for detail? Or just one for both the grids? And how should I bind them to the grids so that a selected master-row shows his detail-row(s) in the detail-grid?

Regards,

zaad

Paul.Lewis
User
Posts: 147
Joined: 22-Aug-2005
# Posted on: 15-Oct-2005 05:05:35   

zaad wrote:

Hello,

I want to use typed lists for displaying read-only data in two grids which are master-detail related. How should I do that? Do I have to create one typed list for master and one for detail? Or just one for both the grids? And how should I bind them to the grids so that a selected master-row shows his detail-row(s) in the detail-grid?

Regards,

zaad

Zaad,

There are several solutions for Master/Detail presentation. I'm wondering:

  1. Are these static reference tables or transactional tables with lots of change?
  2. Are we talking about a small dataset (< 50 rows) or a large dataset (>100 rows); I pulled the numbers out of the air, don't beat me up over them.

If your talking small reference tables then read them from the DB, cache the datatables and bind to your grids using a dataView for the details table. When a master row change event fires, get the details table from cache and rebind the grid with the new dataView.

If your talking large transactional tables then read in the master list and the first set of details. Then fetch details each time a master row change event fires and rebind the details grid.

An alternative presentation control would be a treeView. Depending on what you need to display, the treeView will enable you to load the entire master/detail relationship in a single bind.

The floor is open for more advice and suggestions.

zaad
User
Posts: 19
Joined: 13-Sep-2005
# Posted on: 16-Oct-2005 17:16:43   

If your talking large transactional tables then read in the master list and the first set of details. Then fetch details each time a master row change event fires and rebind the details grid.

I'm talking about large transactional tables. The problem is that I don't want to do any detail-fetching on a masterrow-change because of poor network speed. I want to fetch everything in one go, like prefetch paths.

An alternative presentation control would be a treeView. Depending on what you need to display, the treeView will enable you to load the entire master/detail relationship in a single bind

I don't like treeView. I don't want to force the user to click and expand nodes to see details.

sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 16-Oct-2005 18:13:13   

The problem is that I don't want to do any detail-fetching on a masterrow-change because of poor network speed. I want to fetch everything in one go, like prefetch paths.

On method would be to see if you can use Data Transfer Object (DTO) design pattern - search for it in the forum for referances. What this will mean is that you will fill a data object with all the required data and then send it to the presentation layer to bind to the grids.

Please note, this method has draw back. One that you need to be aware of is that potentially you can 'fill' the data object will ALL the data in your detail table - not good for memory on the client.

You could limit the data by perform this in 'batches' or more commonly known as 'pages' - get the first 50 rows of detail data in your DTO and then get the next 'batch' when the user clicks on 'next'.

I don't like treeView. I don't want to force the user to click and expand nodes to see details.

Personally, I like treeView, but its down to taste if guess - I am told by my wife my taste in clothes is well...testeless !.

Hope this help. Let us know.