<asp:GridView ID="grd1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="False" DataKeyNames="Product_Id" OnRowDataBound="grd1_RowDataBound"> <Columns> <asp:TemplateField HeaderText="Product_Name" SortExpression="Product_Name"> <ItemTemplate> <asp:DropDownList ID="DropDownList1" AutoPostBack="true" runat="server" DataSourceID="SqlDataSource2" DataTextField="Product_Name" Width="100px" DataValueField="Product_Id" AppendDataBoundItems="true" SelectedValue='<%# Bind("Product_ID") %>'> </asp:DropDownList> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Product_Rate" SortExpression="Product_Rate" HeaderText="Product_Rate"/> <asp:TemplateField HeaderText="Product_Quantity" SortExpression="Product_Quantity"> <EditItemTemplate> <asp:TextBox ID="txtQty" runat="server"/> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Product_Amount" SortExpression="Product_Amount"> <ItemTemplate> <asp:Label ID="lblAmount" runat="server" /> </ItemTemplate> </asp:TemplateField> </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 [Product_Id],[Product_Name] FROM [Product_Detail]"> </asp:SqlDataSource> <tr><td align="center"> <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="Submit"/> <asp:Button ID="Button1" runat="server" Text="Clear" OnClick="Clear"/> </td></tr> </table> </center>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)