Zishan Neno
Zishan Neno

Reputation: 2817

RadGrid Ignores Negatives While Sorting

I have a Telerik RadGrid that contains the following columns:

Item Name, Price, Price Change, % of Change

All of the three trailing columns contain decimal data. Price column contains all positive decimals while the other two contain both negatives and positives.

Sorting by Price and Price Change works fine but when I try to sort by the % of Change column, RadGrid seems to ignore the negations. The output of the column is something like:

 0.00
 0.21
-0.39
-0.55
 0.63

Note, that the Price Change column contains similar data but when sorting, it does not treat negative numbers as positives.

Any ideas why this is happening or how it can be resolved?

Upvotes: 0

Views: 373

Answers (1)

Zishan Neno
Zishan Neno

Reputation: 2817

It turned out to be my data source that was converting the % of Change after calculation into a string type. I was using FORMAT(myformula, 2) to convert the percentage into fixed format with two decimal places. Upon using CONVERT(myformula, DECIMAL(11,2) the column sorting seems to be working fine.

Upvotes: 1

Related Questions