Search code examples
c#winformsdevexpressdevexpress-windows-ui

Unbound Expression is not Working Properly in Winform DevExpress?


I Have Gridview in DevExpress Winforms XtraGrid. I Create Unbound Expression to Unbound Column but it not working properly that means it show some other value as result.

my Unbound Expression is

 InPrice.UnboundType = DevExpress.Data.UnboundColumnType.Decimal;
 InPrice.UnboundExpression = "[Price] / (1 + ([Tax] / 100))";

If Price = 6900 and Tax = 5 then Result is Equal to 6571.13 but when i run it show "5349.43.."

What is my error ? can any one help me ?

Thanks in Advance


Solution

  • In order for this to work you will have to convert the numbers to decimal.

    ToDecimal([Price]) *  ((ToDecimal([Tax])/100)+1)