Intersoft WebGrid Documentation
DataSourceEventArgs Class
Members  Example  See Also  Send Feedback
ISNet.WebUI.WebGrid Namespace : DataSourceEventArgs Class






Provides data for datasource related event.

Object Model

DataSourceEventArgs Class

Syntax

Visual Basic (Declaration) 
Public Class DataSourceEventArgs 
   Inherits BaseEventArgs
Visual Basic (Usage)Copy Code
Dim instance As DataSourceEventArgs
C# 
public class DataSourceEventArgs : BaseEventArgs 
Delphi 
public class DataSourceEventArgs = class(BaseEventArgs)
JScript 
public class DataSourceEventArgs extends BaseEventArgs
Managed Extensions for C++ 
public __gc class DataSourceEventArgs : public BaseEventArgs 
C++/CLI 
public ref class DataSourceEventArgs : public BaseEventArgs 

Example

C#Copy Code
private void WebGrid1_InitializeDataSource(object sender,
ISNet.WebUI.WebGrid.DataSourceEventArgs e)
{
    // this event will only invoked once, when the page is loaded
    // the first time or when Refresh is invoked.
    sqlCustomers.Fill(this.dsNorthWind.Customers);
    e.DataSource = this.dsNorthWind;
}

Remarks

WebGrid.NET provides a single databinding event handler that automatically utilizes the built-in data caching mechanism. Developers are highly recommended to use the provided event for maximum performance of data binding process.

The InitializeDataSource event is the default event of WebGrid control, you can write the implementation of it simply by double clicking on the WebGrid control at design-time. The example above shows you a simplified and centralized data binding process codes. You don't even have to call DataBind(), all you need to do is to assign the DataSource to the e.DataSource property.

Inheritance Hierarchy

System.Object
   System.EventArgs
      ISNet.WebUI.WebGrid.BaseEventArgs
         ISNet.WebUI.WebGrid.DataSourceEventArgs

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.