[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IAboveAverage.FromJson

FromJson Method

FromJson(string)

Generates the conditional format from the JSON string.

Use this method to restore the settings of an above average conditional format from a JSON string, such as one generated by ToJson().

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

The JSON string that defines the conditional format.

Examples
worksheet.Range["A1:A5"].Value = new object[,] {{10}, {20}, {30}, {40}, {50}};
string json = "{\"ranges\":[{\"row\":0,\"col\":1,\"rowCount\":5,\"colCount\":1}],\"priority\":1,\"ruleType\":8,\"type\":0}";
IAboveAverage format = worksheet.Range["B1:B5"].FormatConditions.AddAboveAverage();
format.FromJson(json);
format.Interior.Color = Color.Yellow;