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






grid
The reference to the WebGrid object.
dataSource
The reference to the dataSource object.
request
The reference to the request object. The request object is an XmlDocument object.
action
The reference to the PostBackAction of current request.
Invoked when the Grid initiates OnTheFly postback mode. This event allowed you to manipulate most of Grid's actions or create your own custom actions.

Syntax

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

Parameters

grid
The reference to the WebGrid object.
dataSource
The reference to the dataSource object.
request
The reference to the request object. The request object is an XmlDocument object.
action
The reference to the PostBackAction of current request.

Return Value

Returns ReturnValue. Event will be cancelled when ReturnValue is False.

Example

 

The example below shows how to use the event.
C#Copy Code
protected void WG_PostBack (object sender, ISNet.WebUI.WebGrid.PostbackEventArgs e)  
{ 
    if (e.Action == ISNet.WebUI.WebGrid.PostBackAction.ColumnSort)  
    { 
      e.Grid.RootTable.SortedColumns[0].SortOrder =   ISNet.WebUI.WebGrid.SortOrder.Ascending;  
    } 
}

Remarks

One of WebGrid's key features is its ability to retrieve server data and respond to client request without page postback. This enables users to work with the information in more productive, effective and interactive with much faster server respond time compared to standard page roundtrip. This is because the WebGrid architecture implemented many of advanced .NET technologies in which it only renders the element requested by client while preserve the latest state in client, without the need to re-render the whole control's elements that contained in one WebForm page.

By default, WebGrid processes most functionality such as grouping, sorting, filtering, automatically. However, for more precise control to the WebGrid's actions, WebGrid provides a way for developers to fully customize the behavior and default processing through the OnInitializePostBack event.

Note that this event only invoked on OnTheFly postback mode which initiated by WebGrid controls. This event will not invoke on normal postback that initiated by other ASP.Net WebControls.

Through this event, developers can also write custom actions that respond to custom client requests. This enables developers to create more powerful and sophisticated thin-client web applications.

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.