Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi friends

there is a item template in my gridview where in item template there is a textbox..
in textbox some values are displaying but not from database it can be changed dynamicaly by the user


my question is how to get the values inserted by the user in each row and display in another gridview in another page....

C#
<asp:GridView ID="GridView1" runat="server" ShowHeader="False" Width="577px" EmptyDataText="There is Nothing in your Gridview"
            AutoGenerateColumns="False" BackColor="White" BorderColor="White" BorderStyle="Ridge"
            BorderWidth="2px" CellPadding="5" CellSpacing="1" GridLines="None" 
            OnRowCommand="GridView1_RowCommand" DataKeyNames="ProductId" 
            onselectedindexchanging="GridView1_SelectedIndexChanging">
            <rowstyle backcolor="#DEDFDE" forecolor="Black" cssclass="gg" />
            <columns>
               
                <asp:BoundField DataField="ProductName" SortExpression="ProductName" />
                <asp:BoundField DataField="ProductLogDesc" SortExpression="ProductLogDesc" />
                <asp:BoundField DataField="ProductCost" SortExpression="ProductCost" />
              
                <asp:TemplateField>
                    <itemtemplate>
                        <asp:TextBox ID="txtQuantity" Columns="5" Text='<%# Eval("Quantity") %>' runat="server">
                        <asp:LinkButton runat="server" ID="btnRemove" Text="Remove" CommandName="Remove"
                            CommandArgument='<%# Eval("ProductId") %>' Style="font-size: 12px;">
                    </itemtemplate>
                
            </columns>
            <footerstyle backcolor="#C6C3C6" forecolor="Black" />
            <pagerstyle backcolor="#C6C3C6" forecolor="Black" horizontalalign="Right" />
            <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
Posted
Updated 19-Dec-12 18:58pm
v2

1 solution

Build the Item Template dynamically
or

Read the text box values and id from java-script and save it hidden fields then navigate to required page
 
Share this answer
 

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