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

[Solved] Can the grid sort criteria be a function of the column value

3 Answers 98 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.
Umaa Krishnan
Top achievements
Rank 1
Umaa Krishnan asked on 24 Feb 2010, 03:29 AM
Is it possible to sort column values, rather than by absolute value of column value,  by a function of the column value?

Also, when I sort, I automatically want it be grouped by the sort criteria. But in some cases, I want some sort criteria to be explicit. For example when the user clicks on user name, I wish to sort by user name and date.

Thanks

- Umaa

3 Answers, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 26 Feb 2010, 11:18 AM
Hello Umaa,

You can check this help article, which illustrates how to achieve custom sorting. Regarding the grouping please take a look at this article.

Greetings,
Stefan Dobrev
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? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Umaa Krishnan
Top achievements
Rank 1
answered on 04 Mar 2010, 07:52 AM
Thanks... Great Documentation...
I had couple of more Qs...
1)  How do i disable user to enable grouping, ie provide grouping only programmatically. So I want to disallow dragging of columns and the top row, available for columns to be dragged over
2)  When I group, I would like to group by coding the column value, but display should be decode back.
    By this I mean, for example
    custType = "Good" "Excellent" ...
              group using codes say 1, 2,
      but display actual text.

Thanks

- Umaa
0
Pavel Pavlov
Telerik team
answered on 05 Mar 2010, 11:48 AM
Hi Umaa Krishnan,

On question #1 :
You need to set a single property to prevent user initiated grouping :
RadGridView.ShowGroupPanel = false;

On question #2:
To control the value displayed in the group header you may use the RadGridView.GroupHeaderTemplate property.
This way you can place a textblock in the header , bound to the Header property via custom IValueConverter . This converter will do the translation between underlying value and displayed value.

Let me know in case you need further  assistance on implementing these.

Greetings,
Pavel Pavlov
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? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Umaa Krishnan
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Umaa Krishnan
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Share this question
or