Hi -
I'm doing a trial of the the Telerik grid and want to know how to do the following;
Scenario
1. I databind the grid (on the server side) to a List<T> where T is a custom class.
2. This works fine. The grid displays the data.
If my grids page size is N, lets say 3 and my List<T> is > 3 items the grid does paging. But when I try to go to the second page nothing displays. I'm guessing the Grid is expecting a method to populate the next set of data.
In my instance the number of items in List<T> is so small I want ALL of the List<T> to be bound to the grid on the server side call and the grid paging to work without a server call. Is this possible?
I've searched the documentation and can't find anything.
Thanks -
Rob
I'm doing a trial of the the Telerik grid and want to know how to do the following;
Scenario
1. I databind the grid (on the server side) to a List<T> where T is a custom class.
2. This works fine. The grid displays the data.
If my grids page size is N, lets say 3 and my List<T> is > 3 items the grid does paging. But when I try to go to the second page nothing displays. I'm guessing the Grid is expecting a method to populate the next set of data.
In my instance the number of items in List<T> is so small I want ALL of the List<T> to be bound to the grid on the server side call and the grid paging to work without a server call. Is this possible?
I've searched the documentation and can't find anything.
Thanks -
Rob
7 Answers, 1 is accepted
0
Hello Rob,
By default RadGrid paging is disabled, i.e AllowPaging is set to false.
Thus if you DataBind it should not show any pager items.
Below links explain how RadGrid works and how you can bind it:
Event sequence
Telerik RadGrid data binding basics
If you are still experience same behavior please provide us with the markup of RadGrid and how you bind it.
Greetings,
Nikolay
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.
By default RadGrid paging is disabled, i.e AllowPaging is set to false.
Thus if you DataBind it should not show any pager items.
Below links explain how RadGrid works and how you can bind it:
Event sequence
Telerik RadGrid data binding basics
If you are still experience same behavior please provide us with the markup of RadGrid and how you bind it.
Greetings,
Nikolay
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
RDot
Top achievements
Rank 1
answered on 13 May 2009, 01:22 PM
Thanks for the response Nikolay.
I'm not sure i'm stating what I want to do correctly...
Here is what I want
1. Enable paging on the grid
2. But I only want to bind the data one time. Say, the first time the page loads. I don't want each time the user pages to perform a server side request.
Here is some pseudo-code for what I want...
void page_load()
{
If (!this.IsPostBack)
{
this.RadGrid.DataSource = List<T>; //Where T is any type of custom class.
this.RagDrid.DataBind();
}
}
Then I want the grid to have paging, and when the user moves to the next page the data would already exist on the client and no server hit would occur.
It is like all of the data is serialized to the client during the page load and the client portion of the grid manages all the data.
Are you saying once pagng is enabled on the grid, the grid must have a server side method to call as each page is requested?
Thanks -
Rob
I'm not sure i'm stating what I want to do correctly...
Here is what I want
1. Enable paging on the grid
2. But I only want to bind the data one time. Say, the first time the page loads. I don't want each time the user pages to perform a server side request.
Here is some pseudo-code for what I want...
void page_load()
{
If (!this.IsPostBack)
{
this.RadGrid.DataSource = List<T>; //Where T is any type of custom class.
this.RagDrid.DataBind();
}
}
Then I want the grid to have paging, and when the user moves to the next page the data would already exist on the client and no server hit would occur.
It is like all of the data is serialized to the client during the page load and the client portion of the grid manages all the data.
Are you saying once pagng is enabled on the grid, the grid must have a server side method to call as each page is requested?
Thanks -
Rob
0
sp
Top achievements
Rank 1
answered on 14 May 2009, 08:02 PM
I have a similiar situation.
My radgrid(ajaxified) is databound using an asp button. Everytime the button is clicked a texbox value is read and used in the sqlquery parameter. I have enabled paging in the grid.
Here is my psuedocode:
Button_click()
{
buildtable()
}
buildtable()
{
radgrid.datasource = mydataview
radgrid.databind()
}
radgrid_pageindexchanged()
{
buildtable()
}
My pagesize is 6. I want the user to be able to click next page to show 7-12 records. But this is not working.
thanks for any help.
My radgrid(ajaxified) is databound using an asp button. Everytime the button is clicked a texbox value is read and used in the sqlquery parameter. I have enabled paging in the grid.
Here is my psuedocode:
Button_click()
{
buildtable()
}
buildtable()
{
radgrid.datasource = mydataview
radgrid.databind()
}
radgrid_pageindexchanged()
{
buildtable()
}
My pagesize is 6. I want the user to be able to click next page to show 7-12 records. But this is not working.
thanks for any help.
0
sp
Top achievements
Rank 1
answered on 14 May 2009, 08:58 PM
I changed the code to
Button_click()
{
buildtable()
radgrid.databind()
}
buildtable()
{
radgrid.datasource = mydataview
}
radgrid_pageindexchanged()
{
Button_click()
{
buildtable()
radgrid.databind()
}
buildtable()
{
radgrid.datasource = mydataview
}
radgrid_pageindexchanged()
{
radgrid.CurrentPageIndex = e.NewPageIndex
buildtable()
radgrid.DataBind()
}
Now my grid does not update to show the new results after the button is clicked next time.
0
Hello,
Rob - RadGrid does not have such behavior. If you are binding RadGrid server side if will take only PageSize records and show them. Whenever the user attempt to page RadGrid will rebind to get next PageSize records.
SP - I am afraid I do not completely understand the problem which you are facing. Can you elaborate a bit more?
Best wishes,
Nikolay
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.
Rob - RadGrid does not have such behavior. If you are binding RadGrid server side if will take only PageSize records and show them. Whenever the user attempt to page RadGrid will rebind to get next PageSize records.
SP - I am afraid I do not completely understand the problem which you are facing. Can you elaborate a bit more?
Best wishes,
Nikolay
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
Ifdev02
Top achievements
Rank 1
answered on 23 Sep 2009, 08:44 AM
I also have the same problem the Grid has to be bound each postback when paging buttons are clicked. so when i have a button to modify grid it has to bind twice.. I am searching for solution as well.
0
Hello Joe,
Please give the following a try:
http://www.telerik.com/help/aspnet-ajax/grdadvanceddatabinding.html
Regards,
Nikolay
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Please give the following a try:
http://www.telerik.com/help/aspnet-ajax/grdadvanceddatabinding.html
Regards,
Nikolay
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.