[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IFormatConditions.ToJson

ToJson Method

ToJson()

Generates a JSON string from the conditional formats.

Use this method to serialize all conditional formatting rules associated with the range so that they can be stored or later restored with FromJson(string).

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

The conditional formats JSON string.

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