[]
Generates the conditional format from the JSON string.
Use this method to update an existing top or bottom N conditional format from a JSON definition. The JSON must describe a top or bottom N conditional format for this ITop10 object. The caller's range is used to generate the conditional format, so the range information in the JSON is ignored.
void FromJson(string json)
Sub FromJson(json As String)
| Type | Name | Description |
|---|---|---|
| string | json | The JSON string used to generate the conditional format. The format condition type in the JSON must match this ITop10 instance. |
worksheet.Range["A1:A5"].Value = new object[,] {{10}, {30}, {20}, {50}, {40}};
ITop10 top10 = worksheet.Range["A1:A5"].FormatConditions.AddTop10();
top10.FromJson("{\"ruleType\":5,\"style\":{\"backColor\":\"Accent 5\"},\"type\":0,\"rank\":\"2\",\"ranges\":[{\"row\":0,\"rowCount\":5,\"col\":0,\"colCount\":1}]}");
top10.Interior.Color = Color.Yellow;