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

Sorting multiple templated columns

1 Answer 10 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jerry Kurata
Top achievements
Rank 1
Jerry Kurata asked on 19 Mar 2010, 08:18 PM
Hi,

In my radgrid my columns are all created at runtime by creating a datatemplate.  In this datatemplate controls are bound to various data values associated with the cell through a ValueConverter.  I would like to do a custom sort of multiples of these columns using these bound values.  Do you have a sample that can get me started?

Thanks,
Jerry

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 22 Mar 2010, 02:39 PM
Hello Jerry Kurata,

The only way to sort RadGridView is through its SortDescriptors collection. You can add SortDescriptor's to this collection to sort the grid. For example:

this.playersGrid.SortDescriptors.Add(
                new SortDescriptor()
                {
                    Member="Name",
                    SortDirection = System.ComponentModel.ListSortDirection.Descending
                }
                );

The other thing that you can possibly do is attach to the Sorting event and change something according to your custom logic. This is demonstrated in our online example Custom Sorting.

I hope this helps.

Kind regards,
Ross
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
Jerry Kurata
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or