Custom unbound field in TypedList

Posts   
 
    
Rogelio
User
Posts: 221
Joined: 29-Mar-2005
# Posted on: 02-May-2006 16:28:08   

Frans,

I would like to know if the feature to allow add custom unbound field to typedlist will be implemented in v.2.0?

Unbound field: a field that is not fetched from the database; but that is part of the typedlist to allow assign some value to it.

I really need that feature, actually I have two ways to add a custom unbound field to a typedlist:

  1. If the table that I am using to fetch data has some field of the type equal to the type that I need and that field is not part of the set that I am fetching, then I use that field. As you can see this option is not good because I am fetching data that I am not going to use , and what happen when there is not field available to use? Then use option two.

  2. This option is the best; but for each custom unbound field that I need I have to do the following in the typelist:

    • add a line in " __LLBLGENPRO_USER_CODE_REGION_START AdditionalMembers" to declare the datacolumn.
    • add 3 lines in " __LLBLGENPRO_USER_CODE_REGION_START InitClass" to create the datacolumn and add it to the column collection.
    • add a line in " __LLBLGENPRO_USER_CODE_REGION_START InitMembers" to init the datacolumn during deserealization.
    • add the column property declaration in " __LLBLGENPRO_USER_CODE_REGION_START CustomTypedListCode".
    • in the " __LLBLGENPRO_USER_CODE_REGION_START CustomTypedListRowCode" add the declaration to access the field as property and the function to verify if the field is null.

As you can see option 2 is the best; but painfull. cry

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 02-May-2006 16:35:15   

You can add it in code, by overriding the methods called by the routines in the typed list in a partial class. Please see the beta documentation 'Validation System' at the bottom, which methods you've to override.

Frans Bouma | Lead developer LLBLGen Pro
Rogelio
User
Posts: 221
Joined: 29-Mar-2005
# Posted on: 02-May-2006 18:32:03   

Otis wrote:

You can add it in code, by overriding the methods called by the routines in the typed list in a partial class. Please see the beta documentation 'Validation System' at the bottom, which methods you've to override.

Frans,

I know I can add it in code, what I would like is that the typedelist designer allow me to add this field, set its type and the generator generate all the code necesary. If you toll me that this feature is to much right now, then I will continue adding the code manually; but believe me it is a pain.

<Edit>

I will check if that could be implemented with a plug-in.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 02-May-2006 18:36:56   

I can understand it's a pain perhaps, the feature got cut from the designer due to time constraints. What was planned was a feature to have expression columns in the typed list designer, though it took too long to get that right, and the experience would have been not that great either: the actions necessary to be able to add such a column would be as cumbersome as typing the few lines in code.

Frans Bouma | Lead developer LLBLGen Pro
Rogelio
User
Posts: 221
Joined: 29-Mar-2005
# Posted on: 02-May-2006 18:47:46   

I see, then do not worry. May be in the future.