Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add drop down in excel using EPplus

Tags:

c#

excel

epplus

I need help. How can i add a drop down in excel using Epplus? No need for validation. I just need to add this to my template. Records in the drop down are not dynamic.

like image 788
oGuReiSuo Avatar asked Nov 15 '16 16:11

oGuReiSuo


1 Answers

using (ExcelPackage p = new ExcelPackage()) {
    ExcelWorksheet ws = obj.CreateSheet(p, "sheetname", 1, true);
    var unitmeasure = ws.DataValidations.AddListValidation("a1");
    unitmeasure.Formula.Values.Add("Sq Ft");
    unitmeasure.Formula.Values.Add("Meter");
}
like image 90
Siddesh Avatar answered Sep 30 '22 09:09

Siddesh