IEaxRangeFormatConditions.Item

Syntax

Item(Index: Integer): IEaxRangeFormatCondition;

Parameters

Index. Style index in the collection.

Description

The property is read-only.

The Item property returns a style from the collection based on its index.

Comments

Item grants access to a certain style in the collection. Value of the Index parameter must be a non-negative number less than the value of the IEaxRangeFormatConditions.Count property. Index of the first style in a collection is 0, index of the last style equals to IEaxRangeFormatConditions.Count - 1. Index numbering is continuous.

Example

Executing the example requires a form, a button named Button1 on the form, the LanerBox component and the UiErAnalyzer component named UiErAnalyzer1 identifier, that is a data source for LanerBox. The workbook of time series database is to be loaded to the UiErAnalyzer1.

This example is executed on clicking the button.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Grid: IEaxGrid;
    Style: IEaxTableStyle;
    RangeFCond: IEaxRangeFormatConditions;
    Count, i: Integer;
    RangeFormat: IEaxRangeFormatCondition;
    a: String;
    CondType: TabConditionType;
Begin
    Grid := UiErAnalyzer1.ErAnalyzer.Grid;
    Style := Grid.Style;
    RangeFCond := Style.RangeFormatConditions;
    Count := RangeFCond.Count;
    If Count > 0 Then
        For i := 0 To Count - 1 Do
            RangeFormat := RangeFCond.Item(i);
            If RangeFormat.TabRange <> Null Then
                a := " (used)";
            Else
                a := " (not used)";
            End If;
            Debug.WriteLine("Style ?" + i.ToString + a);
            CondType := RangeFormat.Condition.Type;
            Select Case CondType
                Case TabConditionType.Average: a := "Format cells with values higher/lower than average";
                Case TabConditionType.CellContent: a := "Format cells with specified values";
                Case TabConditionType.Duplicate: a := "Format cells with unique/duplicate values";
                Case TabConditionType.Formula: a := "format cells satisfying formula";
                Case TabConditionType.MinMax: a := "format cells with greatest/least values";
                Case TabConditionType.Values: a := "format cells based on their values";
            End Select;
            Debug.WriteLine("    type: " + a);
        End For;
        RangeFCond.Remove(Count - 1);
    End If;
    Grid.Refresh;
End Sub Button1OnClick;

After executing this example the console window shows information on conditional formatting styles applied to the table. Then the last style is removed from the collection.

See also:

IEaxRangeFormatConditions