I've got some Columns in a DataGridView that have their Binding property set to something like the following:
Binding="{Binding NetPrice}"
The problem is that this NetPrice field is a Decimal type and I would like to convert it to Double inside the DataGrid.
Is there some way to do this?
I would create a Converter. A converter takes one variable and "converts" it to another.
There are a lot of resources for creating converters. They are also easy to implement in c# and use in xaml.
Your converter could look similar to this:
Once you've created your converter, you will need to tell your xaml file to include it like this:
in your namespaces (at the very top of your xaml), include it like so:
Then declare a static resource, like so:
Then add it to your binding like this: