This should seem to be a fairly straightforward question, but I’m struggling a bit.
I have a collection of objects that’s I’ve bound to a Grid aling with a Series of GridViewColumns for each property of the object I’d like to display.
One of the columns, however, is currently displaying as an int and I’d like to convert it over to a string. If possible, I’d like the conversion to take place in a different class (at my business layer).
Here’s what I have for that GridViewColumn in my XAML:
<GridViewColumn Header="Status" DisplayMemberBinding="{Binding CourtEventStatusCodeId}" />
What does the method in my Business layer need to look like and how do I use it in conjuction with my XAML?
Thanks in advance,
Sonny
You need a ValueConverter – check out the Binding.Coverter property which should get you started on the right path.
You’d have something like this…
…then when using…
…and you can reuse wherever you like within the same project.