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






Occurs when the grid's layout needs to be initialized during data binding.Manages delegates of the type LayoutEventHandler.

Syntax

Visual Basic (Declaration) 
<CategoryAttribute("Behavior")>
<DescriptionAttribute()>
Public Event InitializeLayout As LayoutEventHandler
Visual Basic (Usage)Copy Code
Dim instance As WebCombo
Dim handler As LayoutEventHandler
 
AddHandler instance.InitializeLayout, handler
C# 
[CategoryAttribute("Behavior")]
[DescriptionAttribute()]
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++ 
[CategoryAttribute("Behavior")]
[DescriptionAttribute()]
public: __event LayoutEventHandler* InitializeLayout
C++/CLI 
[CategoryAttribute("Behavior")]
[DescriptionAttribute()]
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. Gets the LayoutSet object used by the event.
ReturnValue (Inherited from ISNet.WebUI.WebCombo.BaseEventArgs) 

Example

The following example shows you how to bind WebCombo using old databinding mode and set the layout and styles, such as the MultipleColumns, BorderColor and BackColor using InitializeLayout event.
C#Copy Code
private void WebCombo1_InitializeDataSource(object sender, ISNet.WebUI.WebCombo.DataSourceEventArgs e)
{
    oleDbDataAdapter1.Fill(dataSet11.Customers);
    e.DataSource = dataSet11;
}

private void WebCombo1_InitializeLayout(object sender, ISNet.WebUI.WebCombo.LayoutEventArgs e)
{
    e.Layout.ComboMode = Mode.MultipleColumns; 
    WebCombo1.AdditionalSearchFields = "ContactName, City, Country";
    e.Layout.Combo.BorderColor = System.Drawing.Color.Red;
    e.Layout.Combo.BackColor = System.Drawing.Color.Gray;
}

Remarks

In this event you can configure the styles and layout of a WebCombo programmatically. Developers also can configure the ComboMode property as well as the AdditionalSearchFields property. Note that the name of the columns which will be inserted into the AdditionalSearchFields property should be separated by comma (see the sample code above).
You can also configure DataTextField and DataValueField programmatically in InitializeLayout event instead of InitializeDataSource 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.