Data validations

Mar 10, 2011 at 1:30 PM

Hello,

i want to add a data validation into a concrete cell of an excel 2007 file.

the code for creating the data validations is this:

 DataValidations dataValidations1 = new DataValidations(){ Count = (UInt32Value)2U };

            DataValidation dataValidation1 = new DataValidation(){ Type = DataValidationValues.List, AllowBlank = true, ShowInputMessage = true, ShowErrorMessage = true, SequenceOfReferences = new ListValue<StringValue>() { InnerText = "A4 B4" } };
            Formula1 formula11 = new Formula1();
            formula11.Text = "$A$1:$A$3";

            dataValidation1.Append(formula11);

            DataValidation dataValidation2 = new DataValidation(){ Type = DataValidationValues.Whole, AllowBlank = true, ShowInputMessage = true, ShowErrorMessage = true, SequenceOfReferences = new ListValue<StringValue>() { InnerText = "C4" } };
            Formula1 formula12 = new Formula1();
            formula12.Text = "0";
            Formula2 formula21 = new Formula2();
            formula21.Text = "2";

            dataValidation2.Append(formula12);
            dataValidation2.Append(formula21);

            dataValidations1.Append(dataValidation1);
            dataValidations1.Append(dataValidation2);
          
 Now ,i need to append this to the worksheet i am editing with EXTREMEML .How can i get a reference of the DataValidations which allows me to add datavalidations1 object?

I have checked that i can do this:

ExtremeML.Spreadsheet.DataValidationWrapper h = new ExtremeML.Spreadsheet.DataValidationWrapper(); 

but this object "h" i have created doesnt have any method for adding my personalized ones.

What can i do?Thanks a lot!!

Mar 10, 2011 at 1:32 PM

sorry i can´t do

ExtremeML.Spreadsheet.DataValidationWrapper h = new ExtremeML.Spreadsheet.DataValidationWrapper(); 

because it doesnt have a constructor.It was a failed try to do something with the DatavalidationWrapper()that ExtremML provides.
I continue without having any idea of what to do.Thanks