The UltraGridOverride class allows the setting of properties on multiple levels of the grid.
The following sample code shows how to set some UltraGridOverride properties on a grid's DisplayLayout or one of its bands.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim o As Infragistics.Win.UltraWinGrid.UltraGridOverride
' Get the Override from the layout or a specific band (in this case band 2)
If CheckBox1.Checked Then
o = Me.UltraGrid1.DisplayLayout.Override
Else
o = Me.UltraGrid1.DisplayLayout.Bands(2).Override
End If
o.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.TabRepeat
o.AllowColMoving = Infragistics.Win.UltraWinGrid.AllowColMoving.WithinBand
o.AllowColSizing = Infragistics.Win.UltraWinGrid.AllowColSizing.Synchronized
o.AllowColSwapping = Infragistics.Win.UltraWinGrid.AllowColSwapping.WithinGroup
o.AllowDelete = Infragistics.Win.DefaultableBoolean.False
o.AllowGroupBy = Infragistics.Win.DefaultableBoolean.True
o.AllowGroupMoving = Infragistics.Win.UltraWinGrid.AllowGroupMoving.NotAllowed
o.AllowGroupSwapping = Infragistics.Win.UltraWinGrid.AllowGroupSwapping.NotAllowed
o.AllowUpdate = Infragistics.Win.DefaultableBoolean.True
o.BorderStyleCardArea = Infragistics.Win.UIElementBorderStyle.InsetSoft
o.BorderStyleCell = Infragistics.Win.UIElementBorderStyle.Solid
o.BorderStyleHeader = Infragistics.Win.UIElementBorderStyle.Default
o.BorderStyleRow = Infragistics.Win.UIElementBorderStyle.Solid
o.CardSpacing = 2
o.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect
o.CellMultiLine = Infragistics.Win.DefaultableBoolean.False
o.CellPadding = 2
o.CellSpacing = 3
o.DefaultColWidth = 120
o.DefaultRowHeight = 20
o.ExpansionIndicator = Infragistics.Win.UltraWinGrid.ShowExpansionIndicator.CheckOnExpand
o.GroupByColumnsHidden = Infragistics.Win.DefaultableBoolean.True
o.GroupByRowPadding = 2
o.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti
o.MaxSelectedCells = 1000
o.MaxSelectedRows = 100
o.NullText = "{null}"
o.RowSelectors = Infragistics.Win.DefaultableBoolean.True
o.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.Free
o.RowSizingArea = Infragistics.Win.UltraWinGrid.RowSizingArea.EntireRow
o.RowSizingAutoMaxLines = 3
o.RowSpacingAfter = 4
o.RowSpacingBefore = 5
o.SelectTypeCell = Infragistics.Win.UltraWinGrid.SelectType.Extended
o.SelectTypeCol = Infragistics.Win.UltraWinGrid.SelectType.ExtendedAutoDrag
o.SelectTypeGroupByRow = Infragistics.Win.UltraWinGrid.SelectType.Single
o.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.Extended
o.TipStyleCell = Infragistics.Win.UltraWinGrid.TipStyle.Show
o.TipStyleRowConnector = Infragistics.Win.UltraWinGrid.TipStyle.Hide
o.TipStyleScroll = Infragistics.Win.UltraWinGrid.TipStyle.Default
o.ActiveCardCaptionAppearance.BackColor = Color.AliceBlue
o.ActiveCellAppearance.ForeColor = Color.Red
o.ActiveRowAppearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True
o.CardAreaAppearance.BackColor = Color.BlueViolet
o.CardAreaAppearance.BackColor2 = Color.BlanchedAlmond
o.CardAreaAppearance.BackGradientStyle = Infragistics.Win.GradientStyle.VerticalBump
o.CardCaptionAppearance.FontData.SizeInPoints = 20.0
o.CellAppearance.TextTrimming = Infragistics.Win.TextTrimming.EllipsisCharacter
End Sub
'Declaration
Public Class UltraGridOverride
Inherits Infragistics.Shared.KeyedSubObjectBase
Implements Infragistics.Shared.IKeyedSubObject, Infragistics.Shared.IKeyedSubObjectEx, Infragistics.Win.ISupportPresets
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
{
Infragistics.Win.UltraWinGrid.UltraGridOverride o As Infragistics.Win.UltraWinGrid.UltraGridOverride
// Get the Override from the layout or a specific band (in this case band 2)
if (CheckBox1.Checked)
o = Me.UltraGrid1.DisplayLayout.Override;
else
o = Me.UltraGrid1.DisplayLayout.Bands(2).Override;
o.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.TabRepeat;
o.AllowColMoving = Infragistics.Win.UltraWinGrid.AllowColMoving.WithinBand;
o.AllowColSizing = Infragistics.Win.UltraWinGrid.AllowColSizing.Synchronized;
o.AllowColSwapping = Infragistics.Win.UltraWinGrid.AllowColSwapping.WithinGroup;
o.AllowDelete = Infragistics.Win.DefaultableBoolean.False;
o.AllowGroupBy = Infragistics.Win.DefaultableBoolean.True;
o.AllowGroupMoving = Infragistics.Win.UltraWinGrid.AllowGroupMoving.NotAllowed;
o.AllowGroupSwapping = Infragistics.Win.UltraWinGrid.AllowGroupSwapping.NotAllowed;
o.AllowUpdate = Infragistics.Win.DefaultableBoolean.True;
o.BorderStyleCardArea = Infragistics.Win.UIElementBorderStyle.InsetSoft;
o.BorderStyleCell = Infragistics.Win.UIElementBorderStyle.Solid;
o.BorderStyleHeader = Infragistics.Win.UIElementBorderStyle.Default;
o.BorderStyleRow = Infragistics.Win.UIElementBorderStyle.Solid;
o.CardSpacing = 2;
o.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.CellSelect;
o.CellMultiLine = Infragistics.Win.DefaultableBoolean.False;
o.CellPadding = 2;
o.CellSpacing = 3;
o.DefaultColWidth = 120;
o.DefaultRowHeight = 20;
o.ExpansionIndicator = Infragistics.Win.UltraWinGrid.ShowExpansionIndicator.CheckOnExpand;
o.GroupByColumnsHidden = Infragistics.Win.DefaultableBoolean.True;
o.GroupByRowPadding = 2;
o.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti;
o.MaxSelectedCells = 1000;
o.MaxSelectedRows = 100;
o.NullText = "{null}";
o.RowSelectors = Infragistics.Win.DefaultableBoolean.True;
o.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.Free;
o.RowSizingArea = Infragistics.Win.UltraWinGrid.RowSizingArea.EntireRow;
o.RowSizingAutoMaxLines = 3;
o.RowSpacingAfter = 4;
o.RowSpacingBefore = 5;
o.SelectTypeCell = Infragistics.Win.UltraWinGrid.SelectType.Extended;
o.SelectTypeCol = Infragistics.Win.UltraWinGrid.SelectType.ExtendedAutoDrag;
o.SelectTypeGroupByRow = Infragistics.Win.UltraWinGrid.SelectType.Single;
o.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.Extended;
o.TipStyleCell = Infragistics.Win.UltraWinGrid.TipStyle.Show;
o.TipStyleRowConnector = Infragistics.Win.UltraWinGrid.TipStyle.Hide;
o.TipStyleScroll = Infragistics.Win.UltraWinGrid.TipStyle.Default;
o.ActiveCardCaptionAppearance.BackColor = Color.AliceBlue;
o.ActiveCellAppearance.ForeColor = Color.Red;
o.ActiveRowAppearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.True;
o.CardAreaAppearance.BackColor = Color.BlueViolet;
o.CardAreaAppearance.BackColor2 = Color.BlanchedAlmond;
o.CardAreaAppearance.BackGradientStyle = Infragistics.Win.GradientStyle.VerticalBump;
o.CardCaptionAppearance.FontData.SizeInPoints = 20.0;
o.CellAppearance.TextTrimming = Infragistics.Win.TextTrimming.EllipsisCharacter;
}
'Declaration
Public Class UltraGridOverride
Inherits Infragistics.Shared.KeyedSubObjectBase
Implements Infragistics.Shared.IKeyedSubObject, Infragistics.Shared.IKeyedSubObjectEx, Infragistics.Win.ISupportPresets
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