<asp:GridView ID="grd1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="False" DataKeyNames="Product_Id"> <Columns> <asp:TemplateField HeaderText="Product_Name" SortExpression="Product_Name"> <EditItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2" DataTextField="Product_Name" DataValueField="Product_Id" SelectedValue='<%# Bind("Product_Name") %>'> </asp:DropDownList> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("Product_Name") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Product_Rate" SortExpression="Product_Rate" HeaderText="Product_Rate"/> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:chalk_hillConnectionString %>" SelectCommand="SELECT [Product_Id],[Product_Name], [Product_Rate] FROM [Product_Detail]"> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:chalk_hillConnectionString %>" SelectCommand="SELECT DISTINCT [Product_Id],[Product_Name] FROM [Product_Detail]"> </asp:SqlDataSource>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)