Intersoft WebGrid Documentation
OnPrepareDataBinding Method
See Also  Example Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGrid Class : OnPrepareDataBinding Method






dataSource
A reference to the dataSource object.
Invoked when data source ready to be binded. This event allow you to determine whether the data would be binded every postback.

Syntax

Visual Basic (Declaration) 
Public Overridable Function OnPrepareDataBinding( _
   ByVal dataSource As Object _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As WebGrid
Dim dataSource As Object
Dim value As Boolean
 
value = instance.OnPrepareDataBinding(dataSource)
C# 
public virtual bool OnPrepareDataBinding( 
   object dataSource
)
Delphi 
public function OnPrepareDataBinding( 
    dataSource: TObject
): Boolean; virtual; 
JScript 
public function OnPrepareDataBinding( 
   dataSource : Object
) : boolean;
Managed Extensions for C++ 
public: virtual bool OnPrepareDataBinding( 
   Object* dataSource
) 
C++/CLI 
public:
virtual bool OnPrepareDataBinding( 
   Object^ dataSource
) 

Parameters

dataSource
A reference to the dataSource object.

Example

 

The example below shows you how to retrieve structure on WebGrid using code behind.
C#Copy Code
private void WebGrid1_PrepareDataBinding(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
{
     if(!IsPostBack)
     {
       WebGrid1.RetrieveStructure();
     }
}

Remarks

In this event you can populate all the columns structure conveniently. Please note that you might need to place WebGrid1.RetrieveStructure() or WebGrid1.RetrieveHierarchicalStructure() under !IsPostBack condition.

WebGrid will proceed to invoke the PrepareDataBinding event automatically after the InitializeDataSource event is invoked regardless if the InitializeDataSource event contains codes or not.

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.