DataFormatString Issue

Oliver Cox

I am having a problem achieving what I want to with the WPF RadGridView and the DataFormatString property. I have a grid with various numeric values and need to set the format of these values at a row level as opposed to a column level. It has not been possible to bind the DataFormatString to a property of the row data item.

I have tried to use control templates both declarative and programmatic with template selector but the performance is not good compared with the standard GridViewDataColumn implementation.

Is there any way that I can bind to this property or any other suggestions as to how I achieve the requirement of formatting the data of a cell based a property of the row dataitem.

Veselin Vasilev

Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items

Steve Evans

I am faced with a situation where I need to show numeric data in GridViewDataColumn and need to format the string that is shown in the column such that it shows to x number of decimal places. I know that this can be achieved using the DataFormatString however, the number of decimal places that I need to format to can be selected by the user and so I can not just use a static DataFormatString.

I have looked at using a converter in this scenario but this also doesn't seem to fit very well as I would want to pass in the precision/number of required decimal places to the converter from a bound property of the data context of the grid, which cannot be done as the ConverterParameter is not a dependency property.

What would you recommend in this scenario? Any info would be great.

Thanks, Steve

Steve Evans

I have managed to resolve the issue that I raised regarding having the DataFormatString vary depending upon the user input.

Thinking about it now it seems obvious that all I had to do was to bind the DataFormatString property of the GridViewColumn to a property on the data context but when I tried this previously I must have been doing something wrong.

Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.