views:

22

answers:

1

hello,

in a GridView column i need to display a string composed from a set of fields on my view model. how do i bind multiple fields to same column and how do i specify the format string to use for this column?

thanks for any help konstantin

+1  A: 

You could create a new property on your view model to bind to. For example, lets say you have two properties, FirstName & LastName. If you wanted to display the fullname in that column, you could create the new property to bind to, like this:

public string FullName { get { return FirstName + " " + LastName; } }
JSprang
this is a good idea, thanks. it has limitations though, such as it is more difficult to localize because it is in code, not in XAML.
akonsu
Assuming that your localization binding is done using DynamicResources, you can still use those Resources in code-behind.
Wonko the Sane
basically, the answer is that it is impossible, and i need to create a property that combines other properties.
akonsu