Click here to Skip to main content
14,693,821 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello sir,
I have a gridview and I have 5 labels and 5 textboxes and one submit button.
Whenever I enter some values in the textboxes, that values should be displayed on gridview.
My requirement is whenever I open the page, the gridview is not displaying. Whenever I enter some values gridview displaying with values. I want to display the gridview boundfields as empty whenever I open the page. After entering the details, it has to display those values.
I took gridview like below to achieve this.
If anybody knows please help me.
Thank you.

<td colspan="6" style="width:1060;">
  <table class="tableStyleBorder " width="1060">
    <tr>
       <td colspan="6" style="width:1060;">
         <asp:GridView ID="GVProductOrder" runat="server" AutoGenerateColumns="false"

           GridLines="Vertical" Height="100" Width="1055">
           <HeaderStyle CssClass="HeaderStyleGrid" />
           <Columns>
             <asp:BoundField DataField="ItemCode" HeaderText="Item Code" />
             <asp:BoundField DataField="ItemName" HeaderText="Item Name" />
             <asp:BoundField DataField="Cost" HeaderText="Cost" />
             <asp:BoundField DataField="MRP" HeaderText="MRP" />
             <asp:BoundField DataField="SP" HeaderText="SP" />
             <asp:BoundField DataField="MBQ" HeaderText="MBQ" />
             <asp:BoundField DataField="Quantity" HeaderText="Quantity" />
             <asp:BoundField DataField="FreeQty" HeaderText="Free Qty" />
             <asp:BoundField DataField="FixedDisc" HeaderText="Fixed Disc" />
             <asp:BoundField DataField="Tax" HeaderText="Tax" />
             <asp:BoundField DataField="Value" HeaderText="Value" />
             <asp:BoundField DataField="OnOrder" HeaderText="On Order" />
             <asp:BoundField DataField="Remarks" HeaderText="Remarks" />
             <asp:BoundField DataField="Type" HeaderText="Type" />
             <asp:BoundField DataField="EanCode" HeaderText="Ean Code" />
           </Columns>
         </asp:GridView>
       </td>
    </tr>
  </table>
</td>
Posted
Updated 22-Nov-10 21:52pm
v2
Comments
JF2015 23-Nov-10 2:52am
   
Edited for formatting and spelling.

For that u need to create another table temptablename in sql server with same column as in main table after that what u need to do is on click event of button enter values in both the tables and truncate table temptablename .
and bind gridview with this temtablename.
   
v2
hello sir. thanks for your reply.
there is nochance to create new table. is there any other way to display gridview on the page. like take a lable and bind boundfield to label. and display the label on gridview then hide the bound field.

how can do this task. how can i do these things.

if u know plz tell me.
thanking you.
   
Hi,

Firstly inserted data into a datatable then bind this table with grid simultaneously durring submitt click.
   

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