Infragistics(R) NetAdvantage(R) Windows Forms
UseGridAppearances Property
See Also  Example E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace > UltraGridCellProxy Class : UseGridAppearances Property

Gets or sets whether the underlying grid should resolve the appearance of the control.

Syntax

Visual Basic (Declaration) 
Public Property UseGridAppearances As Boolean
C# 
public bool UseGridAppearances {get; set;}

Example

The following snippet demonstrates how to setup the UltraGridCellProxy to pick up appearances from the underlying UltraGrid.

Visual BasicCopy Code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
	' Set the appearance for regular cells
	Dim cellAppearance As Infragistics.Win.AppearanceBase = Me.ultraGrid1.DisplayLayout.Override.CellAppearance
	cellAppearance.BackColor = Color.LightCyan
	cellAppearance.BorderColor = Color.DarkCyan

	' Set the appearance for cells that are being edited
	Dim editAppearance As Infragistics.Win.AppearanceBase = Me.UltraGrid1.DisplayLayout.Override.EditCellAppearance
	editAppearance.BackColor = Color.LightGray
	editAppearance.BorderColor = Color.DarkGray

	' Set the existing UltraGridCellProxy to resolve any appearances from the grid
	Me.ugcpColumn0.UseGridAppearances = True

	' Set the border color of the proxy.  Note that this setting will override whatever 
	' appearances are provided by the grid.
	Me.ugcpColumn0.Appearance.BorderColor = Color.Red
End Sub
C#Copy Code
private void Form1_Load(object sender, EventArgs e)
{
    // Set the appearance for regular cells
    Infragistics.Win.AppearanceBase cellAppearance = this.ultraGrid1.DisplayLayout.Override.CellAppearance;
    cellAppearance.BackColor = Color.LightCyan;
    cellAppearance.BorderColor = Color.DarkCyan;

    // Set the appearance for cells that are being edited
    Infragistics.Win.AppearanceBase editAppearance = this.ultraGrid1.DisplayLayout.Override.EditCellAppearance;
    editAppearance.BackColor = Color.LightGray;
    editAppearance.BorderColor = Color.DarkGray;

    // Set the existing UltraGridCellProxy to resolve any appearances from the grid
    this.ugcpColumn0.UseGridAppearances = true;

    // Set the border color of the proxy.  Note that this setting will override whatever 
    // appearances are provided by the grid.
    this.ugcpColumn0.Appearance.BorderColor = Color.Red;
}

Remarks

Note: the Appearance, EditAppearance, and HotTrackAppearance take precedence over the resolution of the underlying grid.

Note: This property will not change the appearance of the control at design-time.

See Also