[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IFormatCondition.ToJson

ToJson Method

ToJson()

Generates a JSON string from the conditional format.

The returned string represents the current conditional formatting rule and can be used with FromJson(string) to recreate the rule.

Declaration
string ToJson()
Function ToJson() As String
Returns
Type Description
string

The conditional format JSON string.

Examples
IRange range = worksheet.Range["A1:A5"];
range.Value = new object[,] {{10}, {30}, {50}, {70}, {90}};
IFormatCondition condition = (IFormatCondition) range.FormatConditions.Add(
    FormatConditionType.CellValue, FormatConditionOperator.Greater, 60, null);
condition.Interior.Color = Color.Yellow;
string json = condition.ToJson();