Typed Lists and databinding..

Posts   
 
    
Posts: 11
Joined: 29-Apr-2005
# Posted on: 04-May-2005 01:33:31   

How do Typed Lists fit in with databinding given the follwoing scenario..

Using 2 MS datagrids for a typical Master/Detail form. Normally, I could just get a collection object, bind it to the master datagrid, then bind it to the second datagrid, only changing the datamember of the second grid to reflect a child object. This works as desired as the data in the second grid will change when you select a different row in the first grid.

Ok, now, what I want to do is very similar, except instead of binding the grids to a collection and an entity object, I would like to see if Typed Lists can be used to present more UI friendly views of the data. Basically, I just want the second grid to show fields that traverse relations, instead of showing the fields belonging to that child entity.

Anyone have any ideas?

Thanks, Jim

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 04-May-2005 11:56:32   

Jim wrote:

How do Typed Lists fit in with databinding given the follwoing scenario..

Using 2 MS datagrids for a typical Master/Detail form. Normally, I could just get a collection object, bind it to the master datagrid, then bind it to the second datagrid, only changing the datamember of the second grid to reflect a child object. This works as desired as the data in the second grid will change when you select a different row in the first grid.

Ok, now, what I want to do is very similar, except instead of binding the grids to a collection and an entity object, I would like to see if Typed Lists can be used to present more UI friendly views of the data. Basically, I just want the second grid to show fields that traverse relations, instead of showing the fields belonging to that child entity.

Typed Lists are 2 dimensional, i.e. flat, tables or lists, thus don't have a graph-like nature.

In your case, you can create a typed list definition with the fields you want to show in the second grid, and fetch it each time the master grid's selection changes. You then use the selected entity in the master grid for filter creation to fetch the typed list. This doesn't have to be inefficient, as you don't have to fetch the child entities for example and it depends on how many times the user switches/selects rows in the master grid.

One disadvantage: typedlists aren't editable.

Frans Bouma | Lead developer LLBLGen Pro