Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I have a drop down list placed in the edit template of a grid view...
now on the edit button click i have to bind the drop down list... how to do that...

thanks in advance
Posted
Comments
Laiju k 11-Nov-14 2:31am    
are you trying to simply bind or have make the saved value as selected value also

<grid>
<edit item="" template="">
<dropdownlist id="ddltype" runat="server" datasourceid="dstype">
DataTextField="TYPE" DataValueField="TYPE_ID" AppendDataBoundItems="true" >
<sqldatasource id=" runat="server" connectionstring="<br" mode="hold" /> ProviderName="System.Data.OracleClient" SelectCommand= SelectCommandType=text


/xml>
 
Share this answer
 
v2
Comments
[no name] 11-Nov-14 2:45am    
put it in edit item template section of grid view
You can bind dropdownlist on row created event of gridview by finding dropdownlist and you wanna set selected value in dropdownlist then you can give selectedvalue='<%Databinder.Eval("ur column name")%>' in ur control also.

You can follow this link

http://stackoverflow.com/questions/17289556/set-selected-value-or-text-for-dropdownlist-in-edit-mode-of-gridview-asp-net[^]
 
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