Version

LayoutsCollection Class

A collection of Layouts.
Syntax
'Declaration
 
Public Class LayoutsCollection 
   Inherits Infragistics.Shared.KeyedSubObjectsCollectionBase
public class LayoutsCollection : Infragistics.Shared.KeyedSubObjectsCollectionBase 
Example
Following code shows how to use Layouts property to create and store layouts.

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

  Private Sub Button10_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button10.Click

      ' Add a new layout to the layouts collection.
      Me.ultraGrid1.Layouts.Add("L1")
      Me.ultraGrid1.Layouts.Add("L2")

      ' Setup the "L1" layout.
      Me.ultraGrid1.Layouts("L1").Override.CellAppearance.BackColor = Color.Maroon
      Me.ultraGrid1.Layouts("L1").Override.CellAppearance.ForeColor = Color.White

      ' Setup the "L2" layout.
      Me.ultraGrid1.Layouts("L2").Override.CellAppearance.BackColor = Color.LightSkyBlue
      Me.ultraGrid1.Layouts("L2").Override.CellAppearance.ForeColor = Color.DarkBlue

      ' Copy the "L1" layout to the layout of the ultraGrid1 and "L2" layout to the layout 
      ' of ultraGrid2's.
      Me.ultraGrid1.DisplayLayout.CopyFrom(Me.ultraGrid1.Layouts("L1"))
      Me.ultraGrid2.DisplayLayout.CopyFrom(Me.ultraGrid1.Layouts("L2"))

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

private void button10_Click(object sender, System.EventArgs e)
{

	// Add a new layout to the layouts collection.
	this.ultraGrid1.Layouts.Add( "L1" );
	this.ultraGrid1.Layouts.Add( "L2" );

	// Setup the "L1" layout.
	this.ultraGrid1.Layouts["L1"].Override.CellAppearance.BackColor = Color.Maroon;
	this.ultraGrid1.Layouts["L1"].Override.CellAppearance.ForeColor = Color.White;

	// Setup the "L2" layout.
	this.ultraGrid1.Layouts["L2"].Override.CellAppearance.BackColor = Color.LightSkyBlue;
	this.ultraGrid1.Layouts["L2"].Override.CellAppearance.ForeColor = Color.DarkBlue;

	// Copy the "L1" layout to the layout of the ultraGrid1 and "L2" layout to the layout 
	// of ultraGrid2's.
	this.ultraGrid1.DisplayLayout.CopyFrom( this.ultraGrid1.Layouts["L1"] );
	this.ultraGrid2.DisplayLayout.CopyFrom( this.ultraGrid1.Layouts["L2"] );

}
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