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

[Solved] Sort column behaving erratically

3 Answers 108 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ernest Mombay
Top achievements
Rank 1
Ernest Mombay asked on 16 Jul 2009, 01:00 PM
I have set up a RadGrid (that is ajaxify) in a User control. This grid's data is bound dynamically and sometimes through the NeedDataSource event. The Script manager and AjaxManager is in the master page along with a RadTabStrip. I have an AjaxManagerProxy in the user control to ajaxify the grid.

The grid has the following properties:
-Columns are set statically
-Filtering is enabled on the first 4 columns only
-The last column does not have header information as it contains links about the details of each row in the grid
-Paging and sorting is enabled
-I have setup exporting through Excel (in ExcelML) and PDF
-Users can select rows.

Now, whenever I click on the header of a column to sort, ascending sort works. However, weird things start to happen:
-if I click the ^(up) arrow right next to the header text, the third column (2nd column down) gets sorted ascending.
-if I click the first column again, instead of descending sort, it stays in ascending sort.
-if I go down the rows sorting, as in if I click the first column to sort, then click the next column to sort, instead of the next column sorting, it is the next after next column that sorts. (I noticed that the Javascript indexes are changing, don't know why)
-paging to the next page stops at the second page, but that's not as bad as sorting.

I'll post my code when necessary. Any help will be much appreciated.

3 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 21 Jul 2009, 03:33 PM
Hello Ernest,

Is it possible that you set the EnableViewState property of the grid (or at page/application level) to false and this causes the strange sorting/paging behavior in your case?

Another thing you can check is whether you use advanced binding with NeedDataSource even handling or assign a data source control for the grid and at the same time invoke its DataBind() method on each load. This can cause the erratic behavior as well.

If the issue seems to be elsewhere, I suggest you post the markup/code-behind of the problematic page in this forum thread (using the 'Format code block' option from the upper right corner of the forum editor) to examine it further. Thus I will do my best to provide up-to-the-point explanation/solution.

Kind regards,
Sebastian
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
Ernest Mombay
Top achievements
Rank 1
answered on 21 Jul 2009, 05:21 PM
Thanks for the reply Sebastian.

Honestly, there is not really anything in my code that was different. I even used the page you provided as an example, and the grid still did not behave correctly. I know that the code works because I got the functionality from an application that we already had, one that worked. But since we used a content management system, specifically Sitecore, there were alot of unknowns that could cause the issue. Here is the link that helped with the solution. Since I have applied the fix, I haven't had any issues.
0
Sebastian
Telerik team
answered on 22 Jul 2009, 07:57 AM
Hello Ernest,

Thank you for sharing your findings with us - thus you can help other community members who stumble upon similar issue. I updated your Telerik points for the involvement.

Kind regards,
Sebastian
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.
Tags
Grid
Asked by
Ernest Mombay
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Ernest Mombay
Top achievements
Rank 1
Share this question
or