[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.DataValidationJsonError.ErrorContent

ErrorContent Property

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.

Declaration
public string ErrorContent { get; }
Public ReadOnly Property ErrorContent As String
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 errorContent = error.ErrorContent;