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

[Solved] Bug: paging executes databinding twice

5 Answers 221 Views
Grid
This is a migrated thread and some comments may be shown as answers.
none123456
Top achievements
Rank 1
none123456 asked on 18 Feb 2008, 08:39 PM
We are using a RadGrid with paging using the NextPrevNumericAndAdvanced pager style. When executing a paging operation (changing page index or page size, whether via the textbox or page numbers or arrows), the operation itself executes databinding, and then the PreRender on the Grid executes databinding again.

This behavior is especially costly when a database is used for the data source.

The stack trace on the first data bind is as follows:

  System.Web.dll!System.Web.UI.DataSourceView.Select(System.Web.UI.DataSourceSelectArguments arguments, System.Web.UI.DataSourceViewSelectCallback callback = {System.Web.UI.DataSourceViewSelectCallback}) + 0x12 bytes 
  System.Web.dll!System.Web.UI.WebControls.DataBoundControl.PerformSelect() + 0x96 bytes 
  Telerik.Web.UI.DLL!Telerik.Web.UI.GridTableView.PerformSelect() + 0x5 bytes 
  System.Web.dll!System.Web.UI.WebControls.BaseDataBoundControl.DataBind() + 0x47 bytes 
  Telerik.Web.UI.DLL!Telerik.Web.UI.GridTableView.DataBind() + 0x12b bytes 
  Telerik.Web.UI.DLL!Telerik.Web.UI.GridPageChangedEventArgs.ExecuteCommand(object source) + 0x73c bytes 
  Telerik.Web.UI.DLL!Telerik.Web.UI.RadGrid.OnBubbleEvent(object source, System.EventArgs e) + 0x93 bytes 
  System.Web.dll!System.Web.UI.Control.RaiseBubbleEvent(object source = {Telerik.Web.UI.GridTFoot}, System.EventArgs args = {Telerik.Web.UI.GridPageChangedEventArgs}) + 0x24 bytes 
  Telerik.Web.UI.DLL!Telerik.Web.UI.GridItem.OnBubbleEvent(object source, System.EventArgs e) + 0x2d bytes 
  System.Web.dll!System.Web.UI.Control.RaiseBubbleEvent(object source = {Telerik.Web.UI.GridPagerItem}, System.EventArgs args = {Telerik.Web.UI.GridPageChangedEventArgs}) + 0x24 bytes 
  Telerik.Web.UI.DLL!Telerik.Web.UI.GridItem.OnBubbleEvent(object source, System.EventArgs e) + 0x7d bytes 
  System.Web.dll!System.Web.UI.Control.RaiseBubbleEvent(object source = {Text = "2"}, System.EventArgs args = {System.Web.UI.WebControls.CommandEventArgs}) + 0x24 bytes 
  System.Web.dll!System.Web.UI.WebControls.LinkButton.OnCommand(System.Web.UI.WebControls.CommandEventArgs e) + 0x74 bytes 
  System.Web.dll!System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(string eventArgument) + 0x85 bytes 
  System.Web.dll!System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(string eventArgument) + 0x8 bytes 
  System.Web.dll!System.Web.UI.Page.RaisePostBackEvent(System.Web.UI.IPostBackEventHandler sourceControl, string eventArgument) + 0xc bytes 
  System.Web.dll!System.Web.UI.Page.RaisePostBackEvent(System.Collections.Specialized.NameValueCollection postData) + 0xb2 bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequestMain(bool includeStagesBeforeAsyncPoint = true, bool includeStagesAfterAsyncPoint = true) + 0x6d3 bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequest(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint = true) + 0x67 bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequest() + 0x57 bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequestWithNoAssert(System.Web.HttpContext context) + 0x13 bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequest(System.Web.HttpContext context) + 0x32 bytes 
  System.Web.dll!System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 0x167 bytes 
  System.Web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step = {System.Web.HttpApplication.CallHandlerExecutionStep}, ref bool completedSynchronously = true) + 0x41 bytes 
  System.Web.dll!System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(System.Exception error) + 0x1b3 bytes 
  System.Web.dll!System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext context, System.AsyncCallback cb, object extraData) + 0x8e bytes 
  System.Web.dll!System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest wr = {System.Web.Hosting.ISAPIWorkerRequestOutOfProc}) + 0x1b5 bytes 
  System.Web.dll!System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest wr) + 0x62 bytes 
  System.Web.dll!System.Web.Hosting.ISAPIRuntime.ProcessRequest(System.IntPtr ecb, int iWRType) + 0xfd bytes 
  [Appdomain Transition] 
  [Native to Managed Transition] 


The stack trace on the second data bind is as follows:

  System.Web.dll!System.Web.UI.DataSourceView.Select(System.Web.UI.DataSourceSelectArguments arguments, System.Web.UI.DataSourceViewSelectCallback callback = {System.Web.UI.DataSourceViewSelectCallback}) + 0x12 bytes 
  System.Web.dll!System.Web.UI.WebControls.DataBoundControl.PerformSelect() + 0x96 bytes 
  Telerik.Web.UI.DLL!Telerik.Web.UI.GridTableView.PerformSelect() + 0x5 bytes 
  System.Web.dll!System.Web.UI.WebControls.BaseDataBoundControl.DataBind() + 0x47 bytes 
  Telerik.Web.UI.DLL!Telerik.Web.UI.GridTableView.DataBind() + 0x12b bytes 
  System.Web.dll!System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() + 0x53 bytes 
  System.Web.dll!System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(System.EventArgs e = {System.EventArgs}) + 0x14 bytes 
  Telerik.Web.UI.DLL!Telerik.Web.UI.GridTableView.OnPreRender(System.EventArgs e) + 0x28 bytes 
  System.Web.dll!System.Web.UI.Control.PreRenderRecursiveInternal() + 0x57 bytes 
  System.Web.dll!System.Web.UI.Control.PreRenderRecursiveInternal() + 0xab bytes 
  System.Web.dll!System.Web.UI.Control.PreRenderRecursiveInternal() + 0xab bytes 
  System.Web.dll!System.Web.UI.Control.PreRenderRecursiveInternal() + 0xab bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequestMain(bool includeStagesBeforeAsyncPoint = true, bool includeStagesAfterAsyncPoint = true) + 0x7fa bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequest(bool includeStagesBeforeAsyncPoint, bool includeStagesAfterAsyncPoint = true) + 0x67 bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequest() + 0x57 bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequestWithNoAssert(System.Web.HttpContext context) + 0x13 bytes 
  System.Web.dll!System.Web.UI.Page.ProcessRequest(System.Web.HttpContext context) + 0x32 bytes 
  System.Web.dll!System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() + 0x167 bytes 
  System.Web.dll!System.Web.HttpApplication.ExecuteStep(System.Web.HttpApplication.IExecutionStep step = {System.Web.HttpApplication.CallHandlerExecutionStep}, ref bool completedSynchronously = true) + 0x41 bytes 
  System.Web.dll!System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(System.Exception error) + 0x1b3 bytes 
  System.Web.dll!System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext context, System.AsyncCallback cb, object extraData) + 0x8e bytes 
  System.Web.dll!System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest wr = {System.Web.Hosting.ISAPIWorkerRequestOutOfProc}) + 0x1b5 bytes 
  System.Web.dll!System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest wr) + 0x62 bytes 
  System.Web.dll!System.Web.Hosting.ISAPIRuntime.ProcessRequest(System.IntPtr ecb, int iWRType) + 0xfd bytes 
  [Appdomain Transition] 
  [Native to Managed Transition] 


Can you change the behavior during paging so that only data bind is executed, or at least only one call to the data source is performed?

Thanks,

David

5 Answers, 1 is accepted

Sort by
0
Vladimir
Top achievements
Rank 1
answered on 19 Feb 2008, 05:18 AM
Hi David,

Can you please verify if the ViewState is not turned off in your case?

Vlad
0
none123456
Top achievements
Rank 1
answered on 19 Feb 2008, 12:27 PM
No, ViewState is not disabled. I created a simple test page just to investigate this feature, and the problem occurs even there.

I would post a sample page, but I'm not sure what data source to use to demonstrate the problem.

David
0
Vlad
Telerik team
answered on 19 Feb 2008, 12:36 PM
Hi David,

You can use DataTable in your case - please post the code or open a formal support ticket and send us the example.

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
none123456
Top achievements
Rank 1
answered on 19 Feb 2008, 02:54 PM
The problem isn't occurring in some simpler cases now, so it may be an issue with our data source or data source control. I'll post back again with details if the problem still appears to be with the RadGrid.

David
0
none123456
Top achievements
Rank 1
answered on 19 Feb 2008, 03:52 PM
I finally determined that this was a problem with our data source control.

Sorry for the confusion.

David
Tags
Grid
Asked by
none123456
Top achievements
Rank 1
Answers by
Vladimir
Top achievements
Rank 1
none123456
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or