Version

OnInitializeLayout Method (UltraCombo)

Called when the layout is first initialized after the datasource has been set
Syntax
'Declaration
 
Protected Overridable Sub OnInitializeLayout( _
   ByVal e As InitializeLayoutEventArgs _
) 
protected virtual void OnInitializeLayout( 
   InitializeLayoutEventArgs e
)

Parameters

e
Example
Following code initializes ultraCombo1 in InitializeLayout event.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub UltraCombo1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles ultraCombo1.InitializeLayout

      ' InitializeLayout event is a good place to set various appearance and
      ' behaviour related properties.

      ' Set the altername row appearance so that alternating rows appear differently.
      Me.ultraCombo1.DisplayLayout.Override.RowAlternateAppearance.BackColor = Color.LightYellow

      ' Hide columns that you don't want displayed in the drop down.
      Me.ultraCombo1.DisplayLayout.Bands(0).Columns("ProductID").Hidden = True

      ' Sort the rows by ProductName.
      Me.ultraCombo1.DisplayLayout.Bands(0).SortedColumns.Add("ProductName", False)

      ' Set the scroll style to immediate so when the user scrolls the drop down 
      ' using scroll thumb, rows get scrolled imediately.
      Me.ultraCombo1.DisplayLayout.ScrollStyle = ScrollStyle.Immediate

  End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;		

private void ultraCombo1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
{

	// InitializeLayout event is a good place to set various appearance and
	// behaviour related properties.

	// Set the altername row appearance so that alternating rows appear differently.
	this.ultraCombo1.DisplayLayout.Override.RowAlternateAppearance.BackColor = Color.LightYellow;

	// Hide columns that you don't want displayed in the drop down.
	this.ultraCombo1.DisplayLayout.Bands[0].Columns["ProductID"].Hidden = true;

	// Sort the rows by ProductName.
	this.ultraCombo1.DisplayLayout.Bands[0].SortedColumns.Add( "ProductName", false );

	// Set the scroll style to immediate so when the user scrolls the drop down 
	// using scroll thumb, rows get scrolled imediately.
	this.ultraCombo1.DisplayLayout.ScrollStyle = ScrollStyle.Immediate;

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also