RangeFormatConditions: IEaxRangeFormatConditions;
The RangeFormatConditions property returns a collection of conditional formatting styles for a table.
Each collection element is implemented by the IEaxRangeFormatCondition interface.
Executing the example requires a form, a button named Button1 on the form, the LanerBox component and the UiErAnalyzer component named UiErAnalyzer1, that is a data source for LanerBox. The workbook of time series database should be loaded to UiErAnalyzer1. Add a link to the Drawing system assembly.
The example is executed on clicking the button.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Grid: IEaxGrid;
View: ITabView;
Range: ITabRange;
Style: IEaxTableStyle;
RangeFCond: IEaxRangeFormatConditions;
FConditions: ITabFormatConditions;
FormatCond: ITabFormatCondition;
ValFormat: ITabFormatCellContent;
TabStyle: ITabCellStyle;
Begin
Grid := UiErAnalyzer1.ErAnalyzer.Grid;
View := Grid.TabSheet.View;
Range := View.Selection.Range;
FConditions := Range.FormatConditions;
FormatCond := FConditions.Add;
FormatCond.Type := TabConditionType.CellContent;
ValFormat := FormatCond.Details As ITabFormatCellContent;
ValFormat.ContentType := TabFormatContentType.CellValue;
ValFormat.ValueCondition := TabConditionCellContentValue.Above;
ValFormat.CellValue := 0;
TabStyle := New TabCellStyle.Create;
TabStyle.Font.Color := GxColor.FromName("White");
TabStyle.BackgroundColor := GxColor.FromKnownColor(GxKnownColor.Tomato);
ValFormat.Style := TabStyle;
Style := Grid.Style;
RangeFCond := Style.RangeFormatConditions;
RangeFCond.Clear;
RangeFCond.Add(FConditions);
Grid.Refresh;
End Sub Button1OnClick;
After executing the example a new element is added to the collection of table conditional formatting styles. The created style is applied to the selected table area.
See also: