Intersoft WebCombo Documentation
IsFlyDataRequest Property
See Also  Example Send Feedback
ISNet.WebUI.WebCombo Namespace > DataSourceEventArgs Class : IsFlyDataRequest Property






Specifies whether the WebCombo's data request invoke a Postback.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property IsFlyDataRequest As Boolean
Visual Basic (Usage)Copy Code
Dim instance As DataSourceEventArgs
Dim value As Boolean
 
value = instance.IsFlyDataRequest
C# 
public bool IsFlyDataRequest {get;}
Delphi 
public read-only property IsFlyDataRequest: Boolean; 
JScript 
public function get IsFlyDataRequest : boolean
Managed Extensions for C++ 
public: __property bool get_IsFlyDataRequest();
C++/CLI 
public:
property bool IsFlyDataRequest {
   bool get();
}

Example

The following example shows you to retrieve data manually from DataSource (Load on Demand) based on user's queryText, startRow, rowCount and other properties that are available to the context. Insert the codes below in InitializeDataSource event.
C#Copy Code
if (!e.IsFlyDataRequest) 
{
        // the codes below is used to retrieve WebCombo's text value on data binding when page is first load.
        if (WebCombo1.Value != "" && WebCombo1.Value != null) 
        {
                oleDbSelectCommand1.CommandText = "Select * From Customers Where " + WebCombo1.DataValueField + " = '" + WebCombo1.Value + "'";
                oleDbDataAdapter1.Fill(dsNorthWind1);
                e.DataSource = dsNorthWind1;
        }
}
else 
{
        // use following codes to retrieve data when data request is invoked from client.
        int TopRows = e.StartRow + e.RowCount;
        oleDbSelectCommand1.CommandText = "Select TOP " + TopRows + " * From Customers Where " + WebCombo1.DataTextField + " Like '" + e.QueryText + "%'";
        
        // fill data source with a start row and maximum rows, pass it to e.DataSource.
        oleDbDataAdapter1.Fill(dsNorthWind1, e.StartRow, e.RowCount, "Customers");
        e.DataSource = dsNorthWind1;
        // tell WebCombo to skip automatic row parsing because we already implement our own top rows implementation.
        WebCombo1.SkipRowParsing = true;
        // now we need to retrieve original total records of the query in order for WebCombo to show correct total rows.
        // notice that we used fast and lightweight data reader to get the total rows count.
        oleDbConnection1.Open();
        oleDbSelectCommand1.CommandText = "Select Count(CustomerID) From Customers Where " + WebCombo1.DataTextField + " Like '" + e.QueryText + "%'";
        
        OleDbDataReader dr = oleDbSelectCommand1.ExecuteReader(CommandBehavior.CloseConnection);
        dr.Read();
        WebCombo1.TotalDataSourceRows = int.Parse(dr[0].ToString());
}

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

© 2012 Intersoft Solutions Corp. All Rights Reserved.