Add drop down in excel using EPplus

依然范特西╮ 提交于 2019-12-22 12:21:02

问题


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.


回答1:


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");
}


来源:https://stackoverflow.com/questions/40614881/add-drop-down-in-excel-using-epplus

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!