G
Guest
I have added a dropdownlist to an editable datagrid to allow a user to select
Yes or No:
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container.DataItem,
"reports") %>' ID="lblReports"/>
</ItemTemplate>
<EditItemTemplate>
<aspropDownList runat="server" id="ddlReports">
<asp:ListItem value="Yes">Yes</asp:listItem>
<asp:ListItem value="No">No</asp:listItem>
</aspropDownList>
</EditItemTemplate>
</asp:TemplateColumn>
Works great.
My problem occurs when the user clicks the edit button. The value always
comes up to "Yes" in the dropdownlist, even if the value in the datagrid
label was "No".
How do I code it to make the value in the dropdownlist match the value in
the datagrid label before Edit was selected ?
Thanks,
Jeff
Yes or No:
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container.DataItem,
"reports") %>' ID="lblReports"/>
</ItemTemplate>
<EditItemTemplate>
<aspropDownList runat="server" id="ddlReports">
<asp:ListItem value="Yes">Yes</asp:listItem>
<asp:ListItem value="No">No</asp:listItem>
</aspropDownList>
</EditItemTemplate>
</asp:TemplateColumn>
Works great.
My problem occurs when the user clicks the edit button. The value always
comes up to "Yes" in the dropdownlist, even if the value in the datagrid
label was "No".
How do I code it to make the value in the dropdownlist match the value in
the datagrid label before Edit was selected ?
Thanks,
Jeff