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

Cannot achieve Paging or Sorting

2 Answers 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
smith spd
Top achievements
Rank 1
smith spd asked on 14 Jun 2010, 11:27 PM
Hello,

I have requirement for which I am declaring the RadGrid on the serverside ( in a class so that I can call this anywhere in the application).
So, I bind the xml to the RadGrid by using Dataset as a datasource to Grid.
I am perfectly able to bind the xml to Radgrid and populate the Columns.
Here is what I do next:
RadGrid1.Skin = "Default" 
RadGrid1.MasterTableView.Enabled = True 
RadGrid1.ItemStyle.Font.Name = "sans-serif" 
RadGrid1.AllowSortingTrue 
RadGrid1.AllowPaging = True 
RadGrid1.PageSize = "5" 
RadGrid1.HeaderStyle.Font.Bold = True 
The point here is that I loading this into a UserControl.
I am facing the following issues:
1) I am not able to achieve paging.
2) Not able to achieve sorting.
3) Not able to make headertext as Clickable hyperlinks.

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 Jun 2010, 07:56 AM
Hello,

Here I found some hints when adding user control with Telerik RadGrid at run-time.
Loading user control with Telerik RadGrid at runtime

Also refer the following documentation on creating grid dynamically.
Programmatic creation

-Shinu.
0
smith spd
Top achievements
Rank 1
answered on 15 Jun 2010, 07:50 PM
Hello Shinu,

I was able to fix that by customising the pagesize before binding the data.
I have one more issue now, which is pagesize. When i click on dropdown to change the pagesize to 20 or 50, it doesn't fire any event.
Instead, on hitting next would fetch me next page results and then if I change the pagesize, it fires an event with
Error : Unable to Cast Object of Type ASP.test.Master to Type Telerik.Web.UI.GridTableView.
How to handle the pagesize of dropdown from serverside and why doesn't it fire for first time.
I referrred this blog but I was not able to figure out. Please help with a small snippet to handle PageSizeChanged from serverside.

Thanks
Tags
Grid
Asked by
smith spd
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
smith spd
Top achievements
Rank 1
Share this question
or