Version

Override Property (UltraGridBand)

Returns or sets the UltraGridOverride obejct that specifies the formatting and behavior of the band.
Syntax
'Declaration
 
Public Property Override As UltraGridOverride
public UltraGridOverride Override {get; set;}
Remarks

The Override object contains properties for controlling the appearance and behavior of the band and objects (like rows, cells, columns, headers etc...) associated with the band. The UltraGridLayout object also exposes UltraGridLayout.Override property which controls the behavior and appearance of objects of the entire grid, instead of just a single band.

Example
Following code sets CellAppearance on various objects in the UltraGrid. It illustrates how the resolution hierarchy works in the UltraGrid. Basically properties not set on an object get inherited from a higher level object. Highest level object is the Layout and its override. Then is the band and its override then is the column, row and cell in order.

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

  Private Sub Button9_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button9.Click

      ' Get the layout, a band, a column, a row and a cell for the demonstration purpose.
      Dim layout As UltraGridLayout = Me.ultraGrid1.DisplayLayout
      Dim band As UltraGridBand = layout.Bands(0)
      Dim column As UltraGridColumn = band.Columns(0)
      Dim row As UltraGridRow = Me.ultraGrid1.Rows(0)
      Dim cell As UltraGridCell = row.Cells(column)

      ' The way the UltraGrid resolves cell appearance is that objects at a lower level
      ' in the object model hierarchy have higher precedence than objects in higher level.
      ' For example, a cell has a higher precedence than its row. A row has a higher
      ' precedence than a column. The precedence order usually is cell, row, column, band,
      ' layout in decresing precedence order.

      ' Set grid-wide cell appearance by using the layout's Override.
      layout.Override.CellAppearance.BackColor = Color.Yellow

      ' You can override above settings for a a band by setting the 
      ' Override.CellAppearance on the band. This will have higher precedence than
      ' the layout.Override.
      band.Override.CellAppearance.BackColor = Color.Magenta

      ' You can override cell appearance on a column as well so cell-appearance settings
      ' on both the band and the layout will be ignored.
      column.CellAppearance.BackColor = Color.Red

      ' In the same manner, you can override cell-apperance for a row.
      row.CellAppearance.BackColor = Color.Green

      ' You can override the cell-appearance for individual cells.
      cell.Appearance.BackColor = Color.Blue

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

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

	// Get the layout, a band, a column, a row and a cell for the demonstration purpose.
	UltraGridLayout layout = this.ultraGrid1.DisplayLayout;
	UltraGridBand   band   = layout.Bands[0];
	UltraGridColumn column = band.Columns[0];
	UltraGridRow    row    = this.ultraGrid1.Rows[0];
	UltraGridCell    cell   = row.Cells[column];

	// The way the UltraGrid resolves cell appearance is that objects at a lower level
	// in the object model hierarchy have higher precedence than objects in higher level.
	// For example, a cell has a higher precedence than its row. A row has a higher
	// precedence than a column. The precedence order usually is cell, row, column, band,
	// layout in decresing precedence order.

	// Set grid-wide cell appearance by using the layout's Override.
	layout.Override.CellAppearance.BackColor = Color.Yellow;

	// You can override above settings for a a band by setting the 
	// Override.CellAppearance on the band. This will have higher precedence than
	// the layout.Override.
	band.Override.CellAppearance.BackColor = Color.Magenta;

	// You can override cell appearance on a column as well so cell-appearance settings
	// on both the band and the layout will be ignored.
	column.CellAppearance.BackColor = Color.Red;

	// In the same manner, you can override cell-apperance for a row.
	row.CellAppearance.BackColor = Color.Green;

	// You can override the cell-appearance for individual cells.
	cell.Appearance.BackColor = Color.Blue;

}
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