[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ITop10.ToJson

ToJson Method

ToJson()

Generates a JSON string from the conditional format.

Use this method to serialize the current top or bottom N conditional formatting rule so that it can be stored or later restored with FromJson(string).

Declaration
string ToJson()
Function ToJson() As String
Returns
Type Description
string

The conditional format JSON string.

Examples
worksheet.Range["A1:A5"].Value = new object[,] {
    {10}, {30}, {50}, {70}, {90}
};
ITop10 condition = worksheet.Range["A1:A5"].FormatConditions.AddTop10();
condition.Interior.Color = Color.Yellow;
condition.Rank = 3;
string json = condition.ToJson();