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

How to change Group SortOrder dyanmically?

2 Answers 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Liu Peng
Top achievements
Rank 1
Liu Peng asked on 11 Mar 2009, 09:51 AM
Hi,

In my project I add a image on column's header to let user group or ungroup current column, in the same time I add some javascript to call Grid's client API fireCommand("UnGroupByColumn", "") and fireCommand("GroupByColumn", "") on these image's click event, when I click one columns' groupping image, grid will group or ungroup on this column.

Currently groupping image's behavior is: [Group] -> [UnGroup] -> [Group] -> ..., Now, I want to midify their behavior with: [Group ascending] -> [Group descending] -> [UnGroup]
So, how I can implement this function?

I hope Grid's fireCommand can support the following function:
fireCommand("GroupByColumn", "ContactName DESC");
:-)

Regards,
LP

2 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetoslav
Telerik team
answered on 13 Mar 2009, 08:18 AM
Hello Liu Peng,

Thank you for contacting us and for your question.

I am afraid that the fireCommand method does not support such a functionality.

The best way to achieve the implementation you are considering is to use the AjaxManager ajaxRequest client method and handler your group by expressions on the server.

For your convenience, I am sending you a small sample demonstrating how to achieve that.

Please, use it for comparison with your implementation and let me know if I can help you further.

All the best,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Liu Peng
Top achievements
Rank 1
answered on 16 Mar 2009, 07:00 AM
Hello Tsvetoslav,

Thanks for you help, I have completed my request using the AjaxManager ajaxRequest client method.

regards,
LP
Tags
Grid
Asked by
Liu Peng
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Liu Peng
Top achievements
Rank 1
Share this question
or