Back to Devexpress

GridFormatRule.Column Property

windowsforms-devexpress-dot-xtragrid-dot-gridformatrule-2532b2b5.md

latest3.4 KB
Original Source

GridFormatRule.Column Property

Gets or sets a column that provides values to test against the current format rule. By default, the format is applied to this column.

Namespace : DevExpress.XtraGrid

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(null)]
[DXCategory("Behavior")]
public GridColumn Column { get; set; }
vb
<DefaultValue(Nothing)>
<DXCategory("Behavior")>
Public Property Column As GridColumn

Property Value

TypeDefaultDescription
GridColumnnull

The column that provides values to test against the current formatting rule.

|

Remarks

By default, if a cell in the Column meets the current GridFormatRule object, the format is applied to this cell. However, you can choose another target column using the GridFormatRule.ColumnApplyTo property.

In addition, the format can be applied to the entire row. To accomplish this, set the GridFormatRule.ApplyToRow property to true.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Column property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-grid-bind-to-business-objects/CS/GridBoundToRuntimeCreatedData/Form1.cs#L39

csharp
FormatConditionRuleValue formatConditionRuleValue = new FormatConditionRuleValue();
gridFormatRule.Column = gridView1.Columns["RequiredDate"];
formatConditionRuleValue.PredefinedName = "Red Bold Text";

winforms-grid-bind-to-business-objects/VB/GridBoundToRuntimeCreatedData/Form1.vb#L41

vb
Dim formatConditionRuleValue As New FormatConditionRuleValue()
gridFormatRule.Column = gridView1.Columns("RequiredDate")
formatConditionRuleValue.PredefinedName = "Red Bold Text"

See Also

ColumnApplyTo

ApplyToRow

GridFormatRule Class

GridFormatRule Members

DevExpress.XtraGrid Namespace