Answers for "closedxml create excel with dropdown"

0

closedxml create excel with dropdown

var options = new List<string>{"Option1","Option2","Option3"};
var validOptions = $"\"{String.Join(",", options)}\"";
ws.Cell(1,1).DataValidation.List(validOptions, true);

//validOptions contains :
"Option1,Option2,Option3"`

//Your own code should change to :
.List("\"one,two,three\"", true);
Posted by: Guest on March-23-2021
0

closedxml create excel with dropdown

var worksheet2 = workbook.Worksheet(2);

//Applying sheet 2's range validation in sheet 1  where drop down list is to be shown
workbook.Worksheet(1).Column(3).SetDataValidation().List(worksheet2.Range("B2:B4"), true);
Posted by: Guest on March-23-2021

Browse Popular Code Answers by Language