Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
Good Morning

I am creating a order by a grid here. I want to use a button that is available outside from grid. On clicking of this button, the grid creates a row and there are four column dropdown list(item_name),label display rate,textbox for insert quantity,again label for display total amount for that item. After that again display new row until user make all entry for required item.
Finally a button outside of grid is submit. On clicking this button I want to save all values in database.

I have created dropdown but there are add button inside gridview when I click this button all item list display in grid means if in my item master have five item then grid displaying all five row at a time.

How can I complete this task?

What I did, I shared with you. Below is my gridview that is bound with sql-database and dropdown is polpulating item name and rate label display on selection of item name textbox accept quantity from user input last column calculate amount.

<telerik:RadGrid ShowFooter="true" ID="radGrid1" runat="server" OnInsertCommand="radGrid1_InsertCommand"
           AutoGenerateColumns="False" GridLines="None" AllowMultiRowEdit="True" AllowAutomaticInserts="true"
           OnItemDataBound="radGrid1_ItemDataBound" OnNeedDataSource="radGrid1_NeedDataSource">
           <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" PageSize="5" ShowFooter="false"
               CommandItemDisplay="Top" OnPreRender="radGrid1_PreRender">
               <Columns>
                   <telerik:GridTemplateColumn HeaderText="Product Name" UniqueName="Product_Name">
                       <ItemTemplate>
                           <asp:DropDownList ID="ddl1" runat="server" AutoPostBack="true" DataTextField="product_Name"
                               DataValueField="product_Name" OnSelectedIndexChanged="ddl1_SelectedIndexChanged">
                           </asp:DropDownList>
                       </ItemTemplate>
                   </telerik:GridTemplateColumn>
                   <telerik:GridTemplateColumn HeaderText="Product_rate">
                       <ItemTemplate>
                           <asp:Label ID="lblrate" runat="server"></asp:Label>
                       </ItemTemplate>
                   </telerik:GridTemplateColumn>
                   <telerik:GridTemplateColumn HeaderText="Product Quantity">
                       <ItemTemplate>
                           <asp:TextBox ID="txtQuantity" runat="server" />
                       </ItemTemplate>
                   </telerik:GridTemplateColumn>
                   <telerik:GridTemplateColumn HeaderText="Product Amount">
                       <ItemTemplate>
                           <asp:Label ID="lblAmount" runat="server" />
                       </ItemTemplate>
                       <FooterTemplate>
                           <asp:Button ID="btn1" runat="server" Text="Add New Item" OnClick="btn1_click" />
                       </FooterTemplate>
                   </telerik:GridTemplateColumn>

               </Columns>
           </MasterTableView>
       </telerik:RadGrid>



cs><br

Posted
Updated 8-Nov-10 22:50pm
v3

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