Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi...

I want to export data from grid view to excel. i completed the basic thing i.e, from labels in gridview i exported to excel. but i need to export dropdownlistvalues also. is it possible to get dropdownlist to excel by coding.


Thanks in advance....
Posted

1 solution

Yes, you can create dropdown in the excel sheet through .net code. But I don’t think this makes sense because, you should export data that is there in the grid – this includes the dropdown selection as well.

In other words, if PQR is selected in the dropdown column among ABC,PQR and XYZ then you should write PQR in the exported excel sheet (not that copy all 3 in the excel sheet dropdown column and show PQR as selected – this way any one can change exported report values which is not acceptable).

I don’t know what kind of application you are working on but, this is how it should be in normal cases.

I hope this will help you.

~Amol
 
Share this answer
 
Comments
07405 1-Oct-12 8:24am    
i need dropdownlist in excel
Amol_27101982, India 1-Oct-12 8:40am    
Check this:
http://www.techrepublic.com/blog/msoffice/how-to-add-a-drop-down-list-to-an-excel-cell/179
http://office.microsoft.com/en-us/excel-help/create-or-remove-a-drop-down-list-HP005202215.aspx
http://www.videojug.com/film/how-to-create-drop-down-lists-in-excel
http://spreadsheets.about.com/od/datamanagementinexcel/ss/create_list_6.htm

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