Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxSpreadSheetConditionalFormattingRuleDataBarStyle Class

Stores appearance settings of data bars displayed by a Data Bar conditional formatting rule in its affected cell areas.

#Declaration

Delphi
TdxSpreadSheetConditionalFormattingRuleDataBarStyle = class(
    TPersistent
)

#Remarks

A Data Bar conditional formatting rule displays customizable data bars in affected cells:

VCL Spreadsheet: A Data Bar Rule Example

#Main API Members

The list below outlines key members of the TdxSpreadSheetConditionalFormattingRuleDataBarStyle class. These members allow you to customize data bar appearance in affected cells.

ActualNegativeBarBorderColor | ActualNegativeBarColor
Return border and fill colors for data bars that display negative values.
AxisColor | AxisPosition
Allow you to display data bar axes and change their color.
Direction
Specifies the direction of data bars in affected cells.
FillMode
Allows you to switch between solid and gradient fill modes.
NegativeBarBorderColor | PositiveBarBorderColor
Specify data bar border colors.
NegativeBarColor | PositiveBarColor
Specify data bar fill colors.

#Code Example: Apply a Data Bar Conditional Formatting Rule to a Data Grid Column

The following code example creates a data bar conditional formatting rule and applies it to a column in a TcxGrid control’s data-aware Table View:

var
  ARule: TdxSpreadSheetConditionalFormattingRuleDataBar;
begin
  cxGrid1DBTableView1.ConditionalFormatting.Add(cxGrid1DBTableView1Column1.Caption,
              TdxSpreadSheetConditionalFormattingRuleDataBar, ARule);
  ARule.BeginUpdate;  // Initiates the following batch change
  try  
    ARule.Style.NegativeBarColor := clRed;  
    ARule.Style.NegativeBarBorderColor := clRed;  

    ARule.Style.PositiveBarColor := clGreen;  
    ARule.Style.PositiveBarBorderColor := clGreen;  
    ARule.Style.FillMode := dbfmSolid;
  finally  
    ARule.EndUpdate;  // Calls EndUpdate regardless of the batch operation's success
  end;
end;

#Direct TdxSpreadSheetConditionalFormattingRuleDataBarStyle Class Reference

The TdxSpreadSheetConditionalFormattingRuleDataBar.Style property references a TdxSpreadSheetConditionalFormattingRuleDataBarStyle object.

#Inheritance

TObject
TPersistent
TdxSpreadSheetConditionalFormattingRuleDataBarStyle
See Also