I have a excel which has some fields as a dropdown, need to get entire list of the dropdown has. I tried to use the ClosedXML for this. I can able to find whether it is list or not. But unable to read the entire list?
using(var workbook = new XLWorkbook("C:\Data\Test.xlsx"))
{
var workSheetTable = workbook.Worksheets.Worksheet("Template1");
var dropdownList = workSheetTable.Range("A5:F5");
var datavalid = workSheetTable.DataValidations.
GetAllInRange(dropdownList.RangeAddress).ToList();
foreach (var dataValidation in workSheetTable.DataValidations)
{
if (dataValidation.AllowedValues == XLAllowedValues.List)
{
//How to get values of the list
}
}
}