[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IUniqueValues.FromJson

FromJson Method

FromJson(string)

Generates the conditional format from the specified JSON string.

Use this method to restore the settings of a unique-values or duplicate-values conditional formatting rule from its JSON representation, such as a string returned by ToJson().

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

The JSON string that represents a unique-values or duplicate-values

Examples
worksheet.Range["A1:A5"].Value = new object[,] {
    {100}, {100}, {200}, {300}, {300}
};
string json = "{\"ranges\":[{\"row\":0,\"col\":1,\"rowCount\":5,\"colCount\":1}],\"priority\":1,\"ruleType\":7}";
IUniqueValues targetRule = worksheet.Range["B1:B5"].FormatConditions.AddUniqueValues();
targetRule.FromJson(json);
Exceptions
Type Condition
InvalidOperationException

if the JSON string does not represent a unique-values