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

EnableSEOPaging and Sorting

2 Answers 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hajo
Top achievements
Rank 1
Hajo asked on 19 Apr 2010, 08:19 AM
Hi
is there a way to combine EnableSEOPaging and allow keep the sort order while paging?

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/seopaging/defaultcs.aspx?RadGrid1ChangePage=3

Thanks for Help
Hajo

2 Answers, 1 is accepted

Sort by
0
Hajo
Top achievements
Rank 1
answered on 20 Apr 2010, 08:11 AM
I may point out ,
that EnableSEOPaging is very handy, even if it is not for AJAX.

 
0
Veli
Telerik team
answered on 22 Apr 2010, 07:36 AM
Hi Hajo,

This functionality is not supported out of the box for RadGrid. However, you can implement your own SEO sorting mechanism that will work together with SEO paging.

As an example, I have attached an implementation of a custom GridSEOSortPersister class. Instances of this class can be initialized in Page_Init, passing a RadGrid instance in the constructor. And this is all it takes to setup SEO sorting.

Inside the class, there are 2 main tasks that are handled:

1. RadGrid.DataBinding event is hooked up to apply SEO sorting before RadGrid binds. Inside the event handler, the QueryString of the Request URL is parsed to extract and build any specified sort expressions.

2. RadGrid.ItemCreated event is hooked up to modify the header cell of each RadGrid column. The event handler goes through all the sort buttons in the header and replaces them with Hyperlinks. The navigate URLs of these links are built accordingly to facilitate SEO sorting.

Effectively, SEO sorting works just like SEO paging. Each page/sort button is a link to the same URL with appropriate query strings. Check it out.

Greetings,
Veli
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
Grid
Asked by
Hajo
Top achievements
Rank 1
Answers by
Hajo
Top achievements
Rank 1
Veli
Telerik team
Share this question
or