Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using the below code for making Dropdownlist in excel . in that i can't able to have more than 15 records in my dropdown . Is any properties to denote it ? Please give suggestion

C#
var list = new System.Collections.Generic.List<string>();
        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

C#
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;
Posted
Updated 12-Oct-15 23:52pm
v2
Comments
Maciej Los 13-Oct-15 5:55am    
"can't able to have more than 15 records in my dropdown" - have you any error message?
ZurdoDev 13-Oct-15 7:35am    
Why can't you do more than 15?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900