[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IStyle.FromJson

FromJson Method

FromJson(string)

Generates the named style from the JSON string.

Use this method to load a named style definition from JSON, such as a string previously generated by ToJson().

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

The JSON string that contains the named style definition.

Examples
IStyle sourceStyle = workbook.Styles.Add("PriceStyle");
sourceStyle.IncludeNumber = true;
sourceStyle.NumberFormat = "$#,##0.00";
IStyle copiedStyle = workbook.Styles.Add("CopiedPriceStyle");
copiedStyle.FromJson(sourceStyle.ToJson());
worksheet.Range["A1"].Style = copiedStyle;