[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.DataValidationJsonError

DataValidationJsonError Class

Represents a JSON import error related to data validation.

Use this class to inspect details about a data validation entry that could not be processed during JSON import, such as the worksheet that contains the error, the affected range, and the validation content that caused the error. Instances of this class can appear in the list returned by Workbook.FromJson(string).

Inheritance
DataValidationJsonError
Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public sealed class DataValidationJsonError : JsonError
Public NotInheritable Class DataValidationJsonError
    Inherits JsonError
Examples
Workbook sourceWorkbook = new Workbook();
IValidation validation = sourceWorkbook.Worksheets[0].Range["A1:A3"].Validation;
validation.Add(ValidationType.Custom, ValidationAlertStyle.Stop,
    ValidationOperator.Between, "=A1>0", null);
string json = sourceWorkbook.ToJson().Replace("A1>0", "A1>");
Workbook importedWorkbook = new Workbook();
DeserializationOptions options = new DeserializationOptions();
IList<JsonError> errors = importedWorkbook.FromJson(json, options);
DataValidationJsonError error = (DataValidationJsonError)errors[0];
string range = error.Range;

Properties

Name Description
ErrorContent

Gets the data validation content that caused this JSON error.

This property gets the validation content captured for a data validation entry that could not be processed during JSON import, such as a formula or other validation definition stored with the error details.

Range

Gets the cell range associated with the data validation error.

This property gets the range string recorded for the data validation error when JSON content is imported and a data validation issue is detected.

WorksheetName

Gets the name of the worksheet where this data validation JSON error occurred.

This property gets the worksheet name stored in this DataValidationJsonError when the error object was created. The value identifies the worksheet that contains the data validation entry that could not be processed during JSON import.