[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IFormatConditions.FromJson

FromJson Method

FromJson(string)

Generates the conditional formats from the json string.

This method clears the existing conditional formats in the current range first, and then applies new conditional formats from the specified JSON string.

The conditional formats are created in the range on which this method is called. Range information contained in the JSON string is not preserved.

Declaration
void FromJson(string json)
Sub FromJson(json As String)
Parameters
Type Name Description
string json

The JSON string that defines the conditional formats. null is not supported.

Examples
IRange range = worksheet.Range["E2:E7"];
range.Value = new object[,] {{67}, {62}, {72}, {66}, {76}, {68}};
range.FormatConditions.FromJson(
    "{\"rules\":[{\"ruleType\":1,\"operator\":6,\"stopIfTrue\":true,\"ranges\":[{\"row\":1,\"rowCount\":6,\"col\":4,\"colCount\":1}],\"value1\":\"66\",\"value2\":\"70\"}]}"
);