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
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
