Intersoft WebGrid Documentation
InitializePostBack Event
See Also  Example Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGrid Class : InitializePostBack Event






Occurs when when OnTheFlyPostBack action needs to be initialized.

Syntax

Visual Basic (Declaration) 
<DescriptionAttribute()>
<CategoryAttribute("Behavior")>
Public Event InitializePostBack As PostBackEventHandler
Visual Basic (Usage)Copy Code
Dim instance As WebGrid
Dim handler As PostBackEventHandler
 
AddHandler instance.InitializePostBack, handler
C# 
[DescriptionAttribute()]
[CategoryAttribute("Behavior")]
public event PostBackEventHandler InitializePostBack
Delphi 
public event InitializePostBack: PostBackEventHandler; 
JScript 
In JScript, you can handle the events defined by another class, but you cannot define your own.
Managed Extensions for C++ 
[DescriptionAttribute()]
[CategoryAttribute("Behavior")]
public: __event PostBackEventHandler* InitializePostBack
C++/CLI 
[DescriptionAttribute()]
[CategoryAttribute("Behavior")]
public:
event PostBackEventHandler^ InitializePostBack

Event Data

The event handler receives an argument of type PostbackEventArgs containing data related to this event. The following PostbackEventArgs properties provide information specific to this event.

PropertyDescription
Action Gets the action name (PostBackAction) for the requests that initiate the event.
CustomActionData Gets or sets custom action data for requests that initiated by custom request function.
DataSource Gets the assigned WebGrid's DataSource.
Grid Gets the WebGrid object used by the event.
ReturnValue (Inherited from ISNet.WebUI.WebGrid.BaseEventArgs) 
XmlRequest Gets the request in XmlDocument type that contains requests information by clients.

Example

The following example shows that using InitializePostBack event, WebGrid displays a message box when we sort its column.
C#Copy Code
private void WebGrid1_InitializePostBack(object sender, ISNet.WebUI.WebGrid.PostbackEventArgs e)
{
    if (e.Action == PostBackAction.ColumnSort)
    {
       WebGrid1.ClientAction.Alert("Sorting Column")
    }
}

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.

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.