simple calculated columns

Posts   
 
    
dma550
User
Posts: 20
Joined: 11-Feb-2006
# Posted on: 13-Feb-2006 23:41:08   

Hello there

I was using a prior yet somewhat inferior approach to what I trying with llblgen for a few projects.

What I am missing out on though, is the ability to add quick calculated fields, for example:

I store a "source code" as 3 pieces of info, origin, source and trigger.

Origin="T1" Source="NVShow" Trigger="mailing"

Now in my view, for grid display purposes, I had the following:

'srcCode' = sub.Origin + '-' + sub.Source + '-' + trigger

This makes it nice and neat in the grid, but the edit gets the distinct pieces.

Another time I might use it is for zip code, which is stored in zip and zip ext seperately (not my data model). I like to show one column, zip, and have "06412-1212" rather than two columns.

Given that this grid is driven off my entity, is there a way to sneak in simple display only things like this? In other methods, I would have used the view approach, or added some code to my concrete classes to have readonly versions of these calculated fields.

Thanks,

DMA

Posts: 40
Joined: 01-Sep-2005
# Posted on: 14-Feb-2006 00:37:42   

Modify the entities (the entities generated by LLBLGen-Pro) and add custom properties. eg add a property Fullname, this has a get that concatinates 'Firstname' + ' ' + 'lastname'.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Feb-2006 07:19:27   

As Paul has suggested adding a custom property is the key here. Please refer to "Using the generated code -> Adding your own code to the generated classes", for better implementation

dma550
User
Posts: 20
Joined: 11-Feb-2006
# Posted on: 14-Feb-2006 15:47:47   

Thanks guys

Got it working last night, sorry I didn't post back. Yes, I did add a custom property. Works like a charm.

Thanks,

DMA