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






Occurs when the grid's layout needs to be initialized during data binding.

Syntax

Visual Basic (Declaration) 
<DescriptionAttribute()>
<CategoryAttribute("Behavior")>
Public Event InitializeLayout As LayoutEventHandler
Visual Basic (Usage)Copy Code
Dim instance As WebGrid
Dim handler As LayoutEventHandler
 
AddHandler instance.InitializeLayout, handler
C# 
[DescriptionAttribute()]
[CategoryAttribute("Behavior")]
public event LayoutEventHandler InitializeLayout
Delphi 
public event InitializeLayout: LayoutEventHandler; 
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 LayoutEventHandler* InitializeLayout
C++/CLI 
[DescriptionAttribute()]
[CategoryAttribute("Behavior")]
public:
event LayoutEventHandler^ InitializeLayout

Event Data

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

PropertyDescription
Layout Gets the LayoutSet object used by the event.
ReturnValue (Inherited from ISNet.WebUI.WebGrid.BaseEventArgs) 

Example

The following example shows you how to set the WebGrid's layout and styles, such as the AllowEdit, AllowDelete and AllowAddNew properties to Yes.
C#Copy Code
private void WebGrid1_InitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e)
{
        e.Layout.AllowEdit = ISNet.WebUI.WebGrid.Edit.Yes;
        e.Layout.AllowDelete = ISNet.WebUI.WebGrid.Delete.Yes;
        e.Layout.AllowAddNew = ISNet.WebUI.WebGrid.AddNew.Yes;
}

Remarks

This event is an important event in order to modify the grid's layout and styles. You can write the codes to dynamically add Columns, GroupedColumns, or other objects in this event. All the layout settings could be configured and persisted in this event while it will be ignored at other events.

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.