Spread ASP.NET 6.0 Product Documentation
AllowLoadOnDemand Property
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > FpSpread Class : AllowLoadOnDemand Property


Glossary Item Box

Gets or sets whether to allow incremental loads to the client on demand when the user is scrolling.

Syntax

Visual Basic (Declaration) 
Public Property AllowLoadOnDemand As Boolean
Visual Basic (Usage)Copy Code
Dim instance As FpSpread
Dim value As Boolean
 
instance.AllowLoadOnDemand = value
 
value = instance.AllowLoadOnDemand
C# 
public bool AllowLoadOnDemand {get; set;}

Property Value

Boolean: true to allow load-on-demand paging; false otherwise

Example

This example allows the loading of a specified number of rows.
C#Copy Code
protected void PageLoad(object sender, EventArgs e)
{
    string conStr = "Provider=Microsoft.JET.OLEDB.4.0;data source= c:\\nwind.mdb";
    string sqlStr = "SELECT * FROM Orders";
    System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(conStr);
    System.Data.DataSet ds = new System.Data.DataSet();
    System.Data.OleDb.OleDbDataAdapter daCust = new System.Data.OleDb.OleDbDataAdapter(sqlStr, conn);
    daCust.Fill(ds);
    FpSpread1.ActiveSheetView.DataSource = ds;
    
    FpSpread1.ActiveSheetView.PageSize = 200; 
    FpSpread1.AllowLoadOnDemand = true; 
    FpSpread1.LoadInitRowCount = 15; 
    FpSpread1.LoadRowIncrement = 5;
    FpSpread1.ActiveSheetView.AllowPage = false; 
}

 protected void FpSpread1SaveOrLoadSheetState(object sender, FarPoint.Web.Spread.SheetViewStateEventArgs e)
 {
    if (e.IsSave) 
    { 
            Session["sheet1"] = e.SheetView.SaveViewState(); 
    } 
    else 
    { 
            e.SheetView.LoadViewState(Session["sheet1"]); 
    } 
    e.Handled = true;
}
Visual BasicCopy Code
Protected Sub PageLoad(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source= c:\nwind.mdb"
Dim sqlStr As String = "SELECT * FROM Customers"
Dim conn As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection(conStr)
Dim ds As Data.DataSet = New Data.DataSet
Dim daCust As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter(sqlStr, conn)
daCust.Fill(ds)
FpSpread1.ActiveSheetView.DataSource = ds

FpSpread1.ActiveSheetView.PageSize = 15
FpSpread1.AllowLoadOnDemand = True
FpSpread1.LoadInitRowCount = 15
FpSpread1.LoadRowIncrement = 5
FpSpread1.ActiveSheetView.AllowPage = False

End Sub

Protected Sub FpSpread1SaveOrLoadSheetState(ByVal sender As Object, ByVal e As FarPoint.Web.Spread.SheetViewStateEventArgs)
Handles FpSpread1.SaveOrLoadSheetState
If e.IsSave Then

Session("sheet1") = e.SheetView.SaveViewState()

    Else

        e.SheetView.LoadViewState(Session("sheet1"))

    End If

    e.Handled = True


End Sub

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.