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

SortingExpression is always ASC

1 Answer 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Toby
Top achievements
Rank 1
Toby asked on 23 Nov 2010, 01:19 PM
Hi,

I have a grid that's bound to a webservice to provide its data. I have enabled sorting and

function onGridCommand(sender, args) {
        var OldSortExpression = SortExpression;
        var sortExpressions = sender.get_masterTableView().get_sortExpressions();       
        // SortExpression (global) is passed to webservice on rebind of grid.
        SortExpression = sortExpressions.toString();
}

this works ok but the expression returned is always <columnname> ASC the icons change correctly on the grid column but it never changes to DESC when you click on the column again? I assume this is because I'm creating the grid dynamically at runtime and also changing the grid structure dynamically as in :

http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html
http://www.telerik.com/help/aspnet-ajax/grdchanginggridstructuredynamically.html

Any ideas?

thanks
Toby

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 25 Nov 2010, 05:48 PM
Hello Toby,

Even though you change the grid structure on the server, you are databinding it on the client, right? And you are sending the filter expressions to your web service. Then you approach is similar to the one demonstrated in the RadGrid Programmatic Client-side Databinding demo. You can refer to it and see if there are any major differences in the approach you are taking with respect to binding the grid and performing sort/filter/page operations.

Veli
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Toby
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or