V
VB Programmer
I have an itemtemplate in a datagrid. I'm trying to set it's value based on
data. Having no trouble with the textbox. But, how do I do the same thing
for a dropdownlist????
<ItemTemplate>
<aspropDownList id="ddlYesNo" runat="server" >
<asp:ListItem Value="-">-</asp:ListItem>
<asp:ListItem Value="Yes">Yes</asp:ListItem>
<asp:ListItem Value="No">No</asp:ListItem>
</aspropDownList>
<asp:TextBox id="txtComments" runat="server" Width="168px"
Text='<%# DataBinder.Eval(Container.DataItem, "Comments") %>'></asp:TextBox>
</ItemTemplate>
As you can see the TextBox works great! But, how do I set the
DropDownList's value to a similar data field?
Thanks!
data. Having no trouble with the textbox. But, how do I do the same thing
for a dropdownlist????
<ItemTemplate>
<aspropDownList id="ddlYesNo" runat="server" >
<asp:ListItem Value="-">-</asp:ListItem>
<asp:ListItem Value="Yes">Yes</asp:ListItem>
<asp:ListItem Value="No">No</asp:ListItem>
</aspropDownList>
<asp:TextBox id="txtComments" runat="server" Width="168px"
Text='<%# DataBinder.Eval(Container.DataItem, "Comments") %>'></asp:TextBox>
</ItemTemplate>
As you can see the TextBox works great! But, how do I set the
DropDownList's value to a similar data field?
Thanks!