T
tinique
I have a problem, I have a gridview which contain the dropdownlist
when edit. However, some of the records do not contain any value
listed in the dsRoute and when I click the edit link, error will
prompt out. "gvddlRoute has a SelectedValue which is invalid because
it does not exist in the list of items. Parameter name:value" How can
I solve this problem????
<asp:TemplateField SortExpression="Route"
HeaderText="Route"><EditItemTemplate>
<aspropDownList id="gvddlRoute" runat="server"
DataValueField="route" DataTextField="route" DataSourceID="dsRoute"
SelectedValue='<%# if (Bind("Route")!=""){Bind("Route"} %>'></
aspropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label id="Label3" runat="server" Text='<%# Bind("Route") %>'></
asp:Label>
</ItemTemplate>
</asp:TemplateField>
when edit. However, some of the records do not contain any value
listed in the dsRoute and when I click the edit link, error will
prompt out. "gvddlRoute has a SelectedValue which is invalid because
it does not exist in the list of items. Parameter name:value" How can
I solve this problem????
<asp:TemplateField SortExpression="Route"
HeaderText="Route"><EditItemTemplate>
<aspropDownList id="gvddlRoute" runat="server"
DataValueField="route" DataTextField="route" DataSourceID="dsRoute"
SelectedValue='<%# if (Bind("Route")!=""){Bind("Route"} %>'></
aspropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label id="Label3" runat="server" Text='<%# Bind("Route") %>'></
asp:Label>
</ItemTemplate>
</asp:TemplateField>