Thank you for your reply.
If I understood you correctly, you have a HiddenDecimalColumn
, and a TextBoxColumn
that represents the value of the decimal column plus a string ("KB"/"MB"), and you want to have appropriate sorting by clicking on the TextBoxColumn
You have two approaches here:
The first approach (the easiest one) is to make your HiddenDecimalColumn
which contains the decimals visible, and to use this code snippet
to format the displayed text on the way you want. In this case the sorting will work properly, and you don't need TextBoxColumn.
About the second approach, which is more complicated and not perfect, you have to override the OnMouseDownLeft
method to check if the clicked header element is the TextColumn
(the representation of the decimals values as strings) and if it is, to sort the grid according to the HiddenDecimalColumn
. I am attaching a sample project where you could see this.
Please note that when using the second approach, the HeaderElement
(of the TextColumn
) will not
indicate the sorting (the small arrow indicating ASC or DESC order will not appear). What I can suggest is to catch the CellFormating
and for make a custom formatting for the sorted column, if you prefer this approach.
If you have any other questions, do not hesitate to contact us.
the Telerik team
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?
Telerik Public Issue Tracking
system and vote to affect the priority of the items