Xceed Grid for WinForms v4.3 Documentation
Ambient properties
Welcome to Xceed Grid for WinForms v4.3 > Basic Concepts > Appearance > Ambient properties

A property is considered to be ambient when its value has not been explicitly set and is therefore retrieved from its parent. Usually, only properties that affect the visual representation of a grid element, such as BackColor, can inherit their values from their parent.

Ambient parents

Each element in a grid has an ambient parent. For example, in the case of a row, its ambient parent is its containing group. If the row is not contained within a group, then its ambient parent becomes the grid. 

The following diagram represents the ambient hierarchy of some of the classes contained within Xceed Grid for WinForms. The orange circles represent classes and the yellow squares represent the ambient parent: 

 

A more concrete example of the ambient hierarchy is demonstrated in the image below. In this image, you can clearly see that the background color of all the cells in the ShipCity column are purple, with the exception of a single cell in the ValueRow. This was done by setting the BackColor property of the column to purple and explicitly setting the BackColor property of the single cell to green. 

Since the ambient parent of a cell is its parent column, the fact of setting the BackColor property of the data rows to yellow does not affect the color of the cells in the ShipCity column (purple).  

If the background color of the column was not set, then all the purple cells, with the exception of the column's ColumnManagerCell, would have been yellow. The column's ColumnManagerCell would have remained the same color as the ColumnManagerRow.  
In most cases, the default value of a grid element's visual properties is the value of its ambient parent's corresponding property. In some cases however the default value is not the ambient parent's value. For example, although the ambient parent of the ColumnManagerRow, GroupManagerRow and RowSelectorPane is the grid control, if the BackColor property of one of these classes is not set, its default value is not retrieved from its parent.

Resetting ambient properties

If an ambient property such as BackColor has been explicitly set (its value is no longer ambient), it   is possible to reset it back to its ambient value by calling its corresponding "Reset" method. For example, if the BackColor property of a cell has been explicitly set, it can be reset to its ambient value by calling the ResetBackColor method. 

To determine if a visual property has been explicitly set, the appropriate "IsAmbient"property can be consulted.