ComponentOne CalendarView for WinForms
CalendarView for WinForms / Using Controls / DateEdit Features / Data Validation / Pre-validation
In This Topic
    In This Topic

    Pre-validation is raw string validation, which means that rules are applied before parsing.

    DateEdit allows controlling pre-validation of input string through the PreValidation property. The control provides various pre-validation options, as follows:

    The following image shows the DateEdit control displaying validation error message.

    The following code snippet shows how to set various properties to apply pre-validation in DateEdit.

    ' Apply PreValidation in DateEdit
    C1DateEdit1.PreValidation.CaseSensitive = True
    C1DateEdit1.PreValidation.ErrorMessage = "Input mismatch with pattern string"
    C1DateEdit1.PreValidation.ItemSeparator = "|"
    C1DateEdit1.PreValidation.PatternString = "00|11"
    C1DateEdit1.PreValidation.Validation = C1.Win.C1Input.PreValidationTypeEnum.ExactList
    // apply PreValidation in DateEdit
    c1DateEdit1.PreValidation.CaseSensitive = true;
    c1DateEdit1.PreValidation.ErrorMessage = "Input mismatch with pattern string";
    c1DateEdit1.PreValidation.ItemSeparator = "|";
    c1DateEdit1.PreValidation.PatternString = "00|11";
    c1DateEdit1.PreValidation.Validation = C1.Win.C1Input.PreValidationTypeEnum.ExactList;