Version

DisplayLayout Property (UltraGridBase)

Returns the DisplayLayout object that determines the layout of the control. This property is read-only at run-time.
Syntax
'Declaration
 
Public ReadOnly Property DisplayLayout As UltraGridLayout
public UltraGridLayout DisplayLayout {get;}
Remarks

The DisplayLayout property of an object is used to access the DisplayLayout object that determines the settings of various properties related to the appearance and behavior of the object. The DisplayLayout object provides a simple way to maintain multiple layouts for the grid and apply them as needed. You can also save grid layouts to disk, the registry or a storage stream and restore them later.

The DisplayLayout object has properties such as Appearance and Override, so the DisplayLayout object has sub-objects of these types, and their settings are included as part of the layout. However, the information that is actually persisted depends on how the settings of these properties were assigned. If the properties were set using the DisplayLayout object's intrinsic objects, the property settings will be included as part of the layout. However, if a named object was assigned to the property from a collection, the layout will only include the reference into the collection, not the actual settings of the named object.

For example, if the DisplayLayout object's Appearance property is used to set values for the intrinsic Appearance object like this:

UltraWinGrid1.Layout.Appearance.ForeColor = vbBlue

Then the setting (in this case, ForeColor) will be included as part of the layout, and will be saved, loaded and applied along with the other layout data. However, suppose you apply the settings of a named object to the DisplayLayout's Appearance property in this manner:

UltraWinGrid1.Appearances.Add "New1"

UltraWinGrid1.Appearances("New1").ForeColor = vbBlue

UltraWinGrid1.DisplayLayout.Appearance = UltraWinGrid1.Appearances("New1")

In this case, the ForeColor setting will not be persisted as part of the layout. Instead, the layout will include a reference to the "New1" Appearance object and use whatever setting is present in that object when the layout is applied.

By default, the layout includes a copy of the entire Appearances collection, so if the layout is saved and restored using the default settings, the object should always be present in the collection when it is referred to. However, it is possible to use the Load and Save methods of the DisplayLayout object in such a way that the collection will not be re-created when the layout is applied. If this is the case, and the layout contains a reference to a nonexistent object, the default settings for that object's properties will be used.

Example
Following code sets some of the commonly used properties of the UltraGrid in the Form's Load event.

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

  Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

      Me.OleDbDataAdapter1.Fill(Me.DataSet11)
      Me.OleDbDataAdapter2.Fill(Me.DataSet11)
      Me.OleDbDataAdapter3.Fill(Me.DataSet11)

      ' Set the data source and data member to bind the grid.
      Me.UltraGrid1.DataSource = Me.DataSet11
      Me.UltraGrid1.DataMember = ""

      ' Disable alpha-blending which may increase performance.
      Me.UltraGrid1.AlphaBlendEnabled = False

      ' Disable theme support in WinXP based systems.
      Me.UltraGrid1.SupportThemes = False

      ' Set the appearance of the UltraGrid.
      Me.UltraGrid1.DisplayLayout.Appearance.BackColor = Color.Gray

      ' Set the border style of the UltraGrid.
      Me.UltraGrid1.DisplayLayout.BorderStyle = UIElementBorderStyle.InsetSoft

      ' Set the text, appearance and border styles of the caption.
      Me.UltraGrid1.Text = "UltraGrid Caption"
      Me.UltraGrid1.DisplayLayout.CaptionAppearance.FontData.Bold = DefaultableBoolean.True
      Me.UltraGrid1.DisplayLayout.BorderStyleCaption = UIElementBorderStyle.RaisedSoft

      ' Set the update mode which dictates when the UltraGrid calls EndEdit
      ' on IEditableObject row objects.
      Me.UltraGrid1.UpdateMode = UpdateMode.OnRowChangeOrLostFocus

      ' Set the scroll style to Immediate so that the UltraGrid scrolls the rows as
      ' the vertical scroll bar thumb is dragged. Normally the UltraGrid defers the
      ' scrolling until the thumb is released and displays scroll tips instead.
      Me.UltraGrid1.DisplayLayout.ScrollStyle = ScrollStyle.Immediate

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

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

	this.oleDbDataAdapter1.Fill( this.dataSet11 );
	this.oleDbDataAdapter2.Fill( this.dataSet11 );
	this.oleDbDataAdapter3.Fill( this.dataSet11 );

	// Set the data source and data member to bind the grid.
	this.ultraGrid1.DataSource = this.dataSet11;
	this.ultraGrid1.DataMember = "";

	// Disable alpha-blending which may increase performance.
	this.ultraGrid1.AlphaBlendEnabled = false;

	// Disable theme support in WinXP based systems.
	this.ultraGrid1.SupportThemes = false;
	
	// Set the appearance of the UltraGrid.
	this.ultraGrid1.DisplayLayout.Appearance.BackColor = Color.Gray;

	// Set the border style of the UltraGrid.
	this.ultraGrid1.DisplayLayout.BorderStyle = UIElementBorderStyle.InsetSoft;			

	// Set the text, appearance and border styles of the caption.
	this.ultraGrid1.Text = "UltraGrid Caption";
	this.ultraGrid1.DisplayLayout.CaptionAppearance.FontData.Bold = DefaultableBoolean.True;
	this.ultraGrid1.DisplayLayout.BorderStyleCaption = UIElementBorderStyle.RaisedSoft;			
	
	// Set the update mode which dictates when the UltraGrid calls EndEdit
	// on IEditableObject row objects.
	this.ultraGrid1.UpdateMode = UpdateMode.OnRowChangeOrLostFocus;

	// Set the scroll style to Immediate so that the UltraGrid scrolls the rows as
	// the vertical scroll bar thumb is dragged. Normally the UltraGrid defers the
	// scrolling until the thumb is released and displays scroll tips instead.
	this.ultraGrid1.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