Thanks.
5 Answers, 1 is accepted
Could you explain your scenario in a bit more detail, please?
Best wishes,Yavor Georgiev
the Telerik team
Sure. I'm using RadGridView to display financial data. In some of the cells the amount is zero and a "0.00" is
displayed. I would like to create a trigger or a converter which identifies this value and converts it to null.
As you know null values are not displayed in the RadGridView Cells.
See the attached image - it will clarify what I need (I want to get rid of the "0.00" values marked with yellow).
In other words - only to display the values that are greater than zero.
Thanks.
The solution is two-fold. First, your model needs to use a nullable data type. However, float, double, decimal, int, and all of the other basic data types (except string) are value types - they cannot be assign a null value to. To convert them to nullable types, we wrap them in a Nullable<> object.
Second, you need a IValueConverter that takes a value of 0 and converts it to null.
You can find the implemented solution in the attached sample application. Don't hesitate to let me know if you need any further assistance of any kind.
Yavor Georgiev
the Telerik team
Thanks for the prompt reply. I have downloaded the sample project you have attached but I cant open it. It seems that you are working with newer version of visual studio - I'm using Visual Studio Team System 2008. Can you send it as earlier version?
Thanks.
You can open the project file (.csproj) directly, instead of the .sln file. Just go to File > Open > Project/Solution... and choose Sample.csproj from the folder where you extracted the attached app.
Kind regards,Yavor Georgiev
the Telerik team