This is a migrated thread and some comments may be shown as answers.

[Solved] Sorting Converted Data

2 Answers 127 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Seo
Top achievements
Rank 1
Seo asked on 17 Nov 2010, 09:08 AM

Hi,
I want to sort column Data as converted Data type.



 am getting Data via WCF RIA Services, and convert Data string type  into number type using a converter.

and I want to sort these Data  as NUMBER  TYPE(Converted Data Type) with column header click event,

but  sorting is not working properly.

i think , it is sorted as String Data Type(Original DataType).

can you teach me how to sort Data as converted data type?

i attach a file.

thanks.



2 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 17 Nov 2010, 02:44 PM
Hello Seo,

With our latest release we have extended the functionality of the sort descriptors.
A way to perform complex sorting  is demonstrated in this blog post. The example with the sort descriptor demonstrated there can be easily modified to use the converter.

This code can be executed within the Sorting event handler of RadGridView.

In case you need a working example of such implementation with the above  mentioned approach - just let me know are you trying to sort programmatically by adding sort descriptors  or you need sorting by the converted value when the user clicks the column  header.

All the best,
Pavel Pavlov
the Telerik team
See What's New in RadControls for Silverlight in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
0
Seo
Top achievements
Rank 1
answered on 18 Nov 2010, 04:38 AM
Hello, Pavel

Thank you for your reply.
I need sorting by the converted value when the user clicks the column header.

and I have one thing need to know.
that is:
when the user clicks the column  header,
is it always sorting the original value type?
is there no way(sorting the converted value type) if i set specific property?

I've try to the example what you taught me, 
but actually I don't  understand it well now.
I try it more...

thanks.




Tags
GridView
Asked by
Seo
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Seo
Top achievements
Rank 1
Share this question
or