Click here to Skip to main content
15,895,192 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
DataValidations dataValidations1 = new DataValidations();

DataValidation dataValidation2 = new DataValidation() { Type = DataValidationValues.List, AllowBlank = true, ShowInputMessage = true, ShowErrorMessage = true, SequenceOfReferences = new ListValue<stringvalue>() { InnerText = "A4:B4" } };

Formula1 formula12 = new Formula1();

formula12.Text = "$A$1:$A$3";

dataValidations1.Append(dataValidation1);

worksheet1.Append(dataValidations1);


In the above code will add dropdownlist in excel .I've doubt for dropdown how they are adding values . pls suggest .

if my table having raja,ram,raju,bala,guna in list how should i add this in dropdown list ?
ListValue<stringvalue>
Posted
Updated 8-Mar-16 3:00am

1 solution

Replace the line

formula12.Text = "$A$1:$A$3";

with

formula12.Text = "\"raja,ram,raju,bala,guna\"";
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900