I\'m looking for a way to format DataGridViewTextBoxColumn so that the value to be databinded is formatted during databinding. For example I have a CompanyName property and
I generally use ValueConverters for this sort of behavior.
something like:
<DataGridTextColumn Binding={Binding CompanyName, Converter={StaticResource CompanyNameShortenerConverter}} />
In the control/page's resources node, you'll need to add something like:
<local:CompanyNameConverter x:Key="CompanyNameShortenerConverter" />
CompanyNameShortenerConverter should implement IValueConverter, and you can add the logic to "shorten" the company names passed in in the "Convert" method.
This keeps the formatting/UI logic separate from the business logic (i.e. no need to add a "helper property" that shortens the name).