I have a form that has a Dropdown list box and few text boxes etc.
The form is inside ListView control and I am using DataBind to bind data with text boxes and drop down list.
To give you an idea, I have simplified the code and it looks like this:
<asp:ListView ID="ContactSupport" runat="server" OnPreRender="ContactSupport_PreRender">
<ItemTemplate>
<tr>
<td><asp:TextBox ID="txtNetworkProvider" runat="server" Text='<%#Eval("txtNetworkProvider") %>'></asp:TextBox></td>
<td><asp:DropDownList ID="txtTypeOfLine" runat="server" >
<asp:ListItem Text="A" Value="A"></asp:ListItem>
<asp:ListItem Text="12" Value="12"></asp:ListItem>
</asp:DropDownList></td>
</tr>
</ItemTemplate>
</asp:ListView>
ContactSupport_PreRender code behind:
ContactSupport.DataSource = ds.Tables["Records"];
ContactSupport.DataBind();
Problem:
Data binding with text box controls works fine, but what should I do to bind data with dropdown list box?
Note that there are several other text boxes in the form and I just simplified the above code. A screenshot of form is attached below