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