Author: John Federer | Posted on: 12/11/2009 10:23:55 AM | Views : 302

Hi
     I am using Dropdown as a EditTemplate control for GridView. I used the following code to bind and set the selected value when the grod in edit mode  for the dropdown.
 <asp:TemplateField SortExpression="Status" HeaderText="Status" HeaderStyle-HorizontalAlign="center">
<EditItemTemplate>
                        <asp:DropDownList ID="ddlStatus" SelectedValue='<%# Bind("Status") %>'  AppendDataBoundItems="true" DataSource='<%# (new string[] {"SUB","ABC","OK"}) %>'  runat="server"/>

Everything ok when i am in edit mode and select the DropDown items like "SUB","ABC". But when i c ...

Go to the complete details ...