The DataBarFormat class instances are used to set the GridControl's DataBarFormatCondition.Format and PivotGridControl's DataBarFormatCondition.Format properties.
The following image shows the data bar formatting.

The code sample below illustrates how to create the data bar conditional formatting rule with a custom format in markup for GridControl.
XAML |
<dxg:TableView.FormatConditions>
<dxg:DataBarFormatCondition FieldName="SalesVsTarget">
<dx:DataBarFormat FillNegative="Blue" Fill="Red" ZeroLineBrush="Black" />
</dxg:DataBarFormatCondition>
</dxg:TableView.FormatConditions>
|
The code sample below illustrates how to define the same conditional formatting rule in code-behind for GridControl.
C# |
var salesVsTargetFormatCondition = new DataBarFormatCondition() {
FieldName = "SalesVsTarget",
Format = new DataBarFormat() {
FillNegative = Brushes.Blue,
Fill = Brushes.Red,
ZeroLineBrush = Brushes.Black
}
};
view.FormatConditions.Add(salesVsTargetFormatCondition);
|
VB |
Dim salesVsTargetFormatCondition = New DataBarFormatCondition() With {
.FieldName = "SalesVsTarget",
.Format = new DataBarFormat() With {
.FillNegative = Brushes.Blue,
.Fill = Brushes.Red,
.ZeroLineBrush = Brushes.Black
}
}
view.FormatConditions.Add(salesVsTargetFormatCondition)
|
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Freezable
DevExpress.Xpf.Core.ConditionalFormatting.IndicatorFormatBase
DataBarFormat
DataBarFormat