[]
Generates the conditional format from the JSON string.
Use this method to restore a conditional formatting rule from a JSON string, such as one previously generated by ToJson().
void FromJson(string json)
Sub FromJson(json As String)
| Type | Name | Description |
|---|---|---|
| string | json | The JSON string that defines the conditional format. |
worksheet.Range["A1:A5"].Value = new object[,] {{1}, {2}, {3}, {4}, {5}};
string json = "{\"ranges\":[{\"row\":0,\"col\":1,\"rowCount\":5,\"colCount\":1}],\"priority\":1,\"ruleType\":1,\"operator\":2,\"value1\":\"3\",\"value2\":\"\"}";
IFormatCondition condition = (IFormatCondition) worksheet.Range["B1:B5"]
.FormatConditions.Add(FormatConditionType.Expression, FormatConditionOperator.None, "=TRUE", null);
condition.FromJson(json);
condition.Interior.Color = Color.Yellow;