Best Practice for 1:N columns in flat gridview

Posts   
 
    
SpykLee
User
Posts: 8
Joined: 06-Jul-2005
# Posted on: 11-Apr-2007 18:09:53   

Hello,

I've an 1:N relation where the N part are additional columns for the master defined object.

Is there a best practice how to create a 'flat' dataset (for grid purposes) where the childeren are additional columns of the parent.

Although there are many different parent objects with additional columns the idea is that the grid is presenting one specific object at a time (filter on the collection) and so the same specific custom columns should be present for each master-entity.

The end-user is able to define additional custom columns so the solution should be dynamically created.

Any help appreciated!

Eric

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 11-Apr-2007 18:29:06   

Did you consider using a Master-Detail grids design?

If you want to use one grid, then it's easy to fetch the Children rows (the N part of the relation), and then display additional columns form the Parent entity.

For this you can either use a TypedList, DynamicList or "Fields mapped on related fields".

The DynamicList will be the only dynamic solution, since columns are defined at runtime, while in the other solutions, columns are defined at design time.

SpykLee
User
Posts: 8
Joined: 06-Jul-2005
# Posted on: 11-Apr-2007 19:48:58   

Thanks for the quick response!

Athough the implementation is based on a Master-Child table structure, for the end-user it should be experienced as a fixed (flat) table view. So I don't think M/D structure is a good solution.

By DynamicList I assume you mean as mentioned in the help?

Cheers! Eric

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 12-Apr-2007 10:31:15   

By DynamicList I assume you mean as mentioned in the help?

Yes: "Using the generated code -> Adapter/SelfServicing -> Using TypedViews, TypeadLists and Dynamic Lists -> Using dynamic lists"

SpykLee
User
Posts: 8
Joined: 06-Jul-2005
# Posted on: 12-Apr-2007 16:29:36   

I decided to try it on a different approach.

Created a new property in the entity of type HashTable, key is the fieldname, value the data.

Is het possible to alter the propertydescriptor to show the correct data instead of the System.Collections it's showing at the moment?

Thank you for the support so far!

Cheers!

Eric