Click here to Skip to main content
15,884,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,
i have a dropdown list with values all are static not dynamic, so i need to insert this into grid view for inserting new row or on edit i.e updation i need to bind the value of db value to this drop down list, i have written code in edit item template like as following.
<edititemtemplate>
XML
<asp:DropDownList ID="ddlLineSupport" runat="server" DataTextField='<%# Eval("LT Line Supported") %>'>                                
                                <asp:ListItem Value="No">No</asp:ListItem>
                                <asp:ListItem Value="Yes">Yes</asp:ListItem>
                            </asp:DropDownList>


and in item template
XML
<ItemTemplate>
                            <asp:Label ID="lblLineSupport" runat="server" Text='<%# Eval("LT Line Supported") %>'></asp:Label>
                        </ItemTemplate>


but on updating it is taking default first list item value , i need to bind db corresponding value,not first list item value so do i need to change any design code or should i follow row data bound event for binding listitems to dropdown even the values are static values??? can any one tell me which process should i follow???
Posted
Updated 4-Dec-14 18:58pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900