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

i need to set value from database in dropdownlist in asp.net gridview .
Basically i have to show database value in dropdown list's selected column and this dropdown is in one gridview.
Please help me for this.

Regards,
Vimal
Posted
Updated 11-Jul-13 16:13pm
v3

C#
dropdownlist.datasource=dt;
dropdownlist.datavaluefield=columnname;
dropdownlist.datatextfield=columnanme;
dropdownlist.databind();

this is for selection
C#
dropdownlist.selectedvalue=values exists in list of dropdown
 
Share this answer
 
v2
Comments
Member 4316785 14-Jul-13 21:51pm    
Hi Ankit,
Thanks for reply but this dropdown is in Gridview.
This is not normal dropdown.
Dholakiya Ankit 14-Jul-13 23:11pm    
then?
 
Share this answer
 
 
Share this answer
 

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