TypedList custom property consisting of another properties values

Posts   
 
    
noobix
User
Posts: 14
Joined: 06-Nov-2007
# Posted on: 19-Feb-2008 15:32:50   

I have defined a TypedList including 2 properties Amount and Currency.

Now I'd like create a custom property that concatenates both properties, something like:

name: AmountWithCurrency value: Amount + " " + Currency

Can I reference another properties in the custom property value? Am I going to end up with a simple string value "Amount Currency" instead of the real values of those properties?

Is there a way to achieve that with TypedLists?

Regards, Tino

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 19-Feb-2008 17:23:53   

you can do this 1 of 2 ways. either server side (db) or client side (code). I would opt for client side.

create a partial class for your typed list and override a few methods to 1(add another column to the typed list. 2. define a column in the typed list. I can't remember all the exact functions to override, but it's straight forward if you look at the generated code for the typed list.

because typedlists are datatables it can be as simple as creating a new column and defining the Expression property.