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

Question re: data transfer

2 Answers 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark Galbreath
Top achievements
Rank 2
Mark Galbreath asked on 17 Feb 2010, 06:03 PM
I have a paginated radgrid that connects to a table with 23k records, of which I have 500 records displayed per page.  Now, it takes a long time to get this first display, as I would expect for such a large DataSet.  The problem is that it takes just as long to display another page of the radgrid, like it is going back to the database, refilling the DataSet, and then paging the data into the new display.

I am using the object source design pattern (simplified MVC), where (1) view (ASPX) requests data -> (2) controller (ASP .NET) invokes data access object -> (3) DAO queries database and stores DataSet as model in Application scope if it is not already present -> (4) controller delivers requested data to view

When radgrid needs another page of data, isn't that data readily available in the DataSet?  Is the entire DataSet sent to the client (which is what I want) for quicker page transitions?

Relevant ASPX:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadGrid1">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelRenderMode="block" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 
 
<telerik:RadGrid ID="radGrid1" runat="server">  
    <MasterTableView> 
    <Columns> 
        <telerik:GridHyperLinkColumn DataTextField = "LIN" HeaderText = "LIN" DataNavigateUrlFields = "LIN" UniqueName = "lin"></telerik:GridHyperLinkColumn> 
 
    * * *  
    </Columns> 
    </MasterTableView> 
</Telerik:RadGrid> 

Relevant Codebehind:
Protected Sub radGrid1_Load( sender As Object, e As EventArgs) Handles radGrid1.Load  
    Try  
        If Application( "lins" ) Is Nothing Then  
            Application( "lins" ) = dao_LIN.Get_LINs()  
        End If  
 
        radGrid1.DataSource = DirectCast( Application( "lins" ), DataSet )  
        radGrid1.DataBind()  
 
    Catch ex As HttpException   
        RadAjaxManager1.Alert( "Communication with the database failed: " & ex.Message())  
        Response.Redirect( "/Lexis/Lexis_error.aspx?module=rcm" )  
    End Try  
End Sub 

The DAO (without exception code):
<DataObject( True )> _  
Public Class dao_LIN  
    <DataObjectMethod( DataObjectMethodType.Fill )> _  
    Public Shared Function Get_LINs() As DataSet  
        Dim ds As DataSet = New DataSet()  
        Dim cmd As OracleCommand = New OracleCommand( "select * from VW_LIN_REF_WITH_COSTS order by LIN", dao_Conn.Instance( "OracleConnectionString" ))  
 
        Dim da As OracleDataAdapter = New OracleDataAdapter( cmd )  
        da.Fill( ds )  
 
        Return ds  
End Function     

Seems pretty straight-forward to me.  What am I missing so that I can get the pagination on the client to be very fast?

Cheers!
Mark

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 18 Feb 2010, 08:08 AM
Hi Mark,

Telerik RadGrid supports Custom Paging technique which allows you to fetch only a fixed number of records and perform operations over this specified set of data.

Hope this helps.

Thanks,
Princy
0
Mark Galbreath
Top achievements
Rank 2
answered on 19 Feb 2010, 01:44 PM
Thanks, Princy!  I've been wondering what the AllowCustomPaging switch is for.

Cheers!
Mark
Tags
Grid
Asked by
Mark Galbreath
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Mark Galbreath
Top achievements
Rank 2
Share this question
or