[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IValidation.FromJson

FromJson Method

FromJson(string)

Generates the data validation from the JSON string.

Calling this method clears the existing data validation in the current range and then applies the data validation defined by the specified JSON string. If both the current API call and the JSON content provide range information, the current range is applied and the range information in the JSON string is ignored.

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

The JSON string that describes the data validation to apply.

Examples
IValidation validation = worksheet.Range["A1:B2"].Validation;
validation.FromJson("{\"inputTitle\":\"Tip\",\"inputMessage\":\"Value must be between 5 and 20.\"," +
    "\"type\":1,\"condition\":{\"conType\":0,\"compareType\":1,\"item1\":{\"conType\":1," +
    "\"compareType\":3,\"expected\":\"5\",\"integerValue\":true},\"item2\":{\"conType\":1," +
    "\"compareType\":5,\"expected\":\"20\",\"integerValue\":true},\"ignoreBlank\":true},\"ranges\":\"C3:D4\"}");