I am filling the Excel cells as row and column using C# in my entire project as given below. Now there is a new requirement to add a dropdownlist in the particular cell.
First make a list for dropdown
var list = new System.Collections.Generic.List();
list.Add("Charlie");
list.Add("Delta");
list.Add("Echo");
var flatList = string.Join(",", list.ToArray());
then add this list as dropdown in the particular cell as below
var cell = (Microsoft.Office.Interop.Excel.Range)oSheet.Cells[row, 8];
cell.Validation.Delete();
cell.Validation.Add(
XlDVType.xlValidateList,
XlDVAlertStyle.xlValidAlertInformation,
XlFormatConditionOperator.xlBetween,
flatList,
Type.Missing);
cell.Validation.IgnoreBlank = true;
cell.Validation.InCellDropdown = true;