views:

25

answers:

1

Let's say I am using databinding like this:

List<Entity> Entities = <some data>

entityBinding.DataSource = Entities;
lstEntities.DisplayMember = "Description";

which works fine. However, I want to manipulate the string coming back as the Entity's "Description". How can I call a function on DisplayMember?

+1  A: 

You cannot call a function on that field - but you could create a new property on your entity called MyDescription which does to Description whatever it is you want to do, and then use that new property as your DisplayMember

marc_s
Alright...that is a bit of a shame.
DanDan