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

async databinding

1 Answer 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adam Macaulay
Top achievements
Rank 1
Adam Macaulay asked on 13 Aug 2010, 04:00 PM
Hello,

I'm trying to make use of the NeedDataSource event in order to bind the grid to a datasource that may cause a page timeout.  The data collection process is pretty hefty, and I need to be able to load everything on the page without having to wait for the grid to collect its data.  The html looks like this:

<

 

 

telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" >

 

<

 

 

asp:Image id="imgLoading" runat="server" ></asp:Image>

 

</

 

 

telerik:RadAjaxLoadingPanel>

 

<

 

 

telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">

 

<

telerik:RadGrid ID="CWGrid" runat="server" Width="100%" OnNeedDataSource="CWGrid_NeedDataSource" >

 

</

 

 

telerik:RadGrid>

 

</

 

 

telerik:RadAjaxPanel>

 



And in the Need Data Source:

public

 

 

void CWGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)

 

{

 

 

DataSet objSD = SetData();

 

 

 

if (objDS.Tables.Count > 0)

 

CWGrid.DataSource = objDS;

}



SetData() is where the data collection occurs, and sometimes causes a page timeout.   Please let me know what I'm missing.

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 19 Aug 2010, 10:02 AM
Hello Adam,

Could you please elaborate bit more on the problem you are facing. Does the grid times out during its initial load or in any particular operation? The provided code looks ok to me, however note that the problem is mostly related to the data size you are passing to the control.

Also tips on how to optimize the RadGrid performance using different techniques can be found in the online resources linked below:
http://www.telerik.com/help/aspnet-ajax/gridoverview.html (Chapter "Performance tips and tricks")
http://www.telerik.com/products/aspnet-ajax/resources/top-performance.aspx
http://www.telerik.com/support/aspnet-ajax.aspx (Section "Performance")

Moreover, you can examine the demos from the 'Performance' section of the RadGrid QSF which apply those methods in reality:
http://demos.telerik.com/aspnet-ajax/grid/examples/overview/defaultcs.aspx

Kind regards,
Maria Ilieva
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
Adam Macaulay
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or