This project has moved. For the latest updates, please go here.

Operator for Validation is alway Any.

May 28, 2014 at 8:00 AM
Edited May 28, 2014 at 8:01 AM

on the vaidation the operator type is Always any. is this a bug?

If got an class which retrieves all the validations for a worksheet.
   private ValidationBase Convert(IExcelDataValidation validationData)

        switch (validationData.ValidationType.Type)
            case eDataValidationType.Custom:
            case eDataValidationType.DateTime:
                return ConvertToDateTime((ExcelDataValidationDateTime) validationData);

            case eDataValidationType.Decimal:
            case eDataValidationType.List:
                return ConvertToListValidation((ExcelDataValidationList) validationData);

            case eDataValidationType.TextLength:
            case eDataValidationType.Time:
            case eDataValidationType.Whole:
                return ConvertToIntegerValidation((ExcelDataValidationInt)validationData);
        return null;

for the int conversion i've got this function
    private ValidationGeneric<int?> ConvertToIntegerValidation(ExcelDataValidationInt validationData)
        int? value1 = GetIntValueFor(validationData.Formula);
        int? value2 = GetIntValueFor(validationData.Formula2);
        return new IntegerValidation().SetMinMaxValue(value1,value2);
Now i want to extend the functionality. so i can determine if the validation is between. not between..... and so on.

but now the operator is alway .any.

is this a bug?
Jun 1, 2014 at 4:55 AM

yes it is a bug. It was fixed a few weeks ago and will be included in 4.0 which we hope to release soon.

Until then you must download and build the latest source code yourself.