显示GridView边界域 [英] display gridview boundfields

查看:98
本文介绍了显示GridView边界域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生您好,
我有一个gridview,我有5个标签,5个文本框和一个提交按钮.
每当我在文本框中输入一些值时,这些值都应显示在gridview上.
我的要求是,每当我打开页面时,gridview都不会显示.每当我输入一些值时,gridview就会显示值.每当我打开页面时,我都希望将gridview边界域显示为空.输入详细信息后,它必须显示这些值.
我采用如下所示的gridview来实现这一目标.
如果有人知道,请帮助我.
谢谢.

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>

推荐答案

为此,您需要在sql服务器中创建另一个表temptablename,该表的temptablename与主表中的列相同,之后您需要做的是在click事件上按钮在两个表中输入值并截断表temptablename.
并使用此temtablename绑定gridview.
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.


您好,先生.感谢您的答复.
有创建新表的机会.还有什么其他方法可以在页面上显示gridview.像拿一个标签,然后将boundfield绑定到label.并在gridview上显示标签,然后隐藏绑定的字段.

怎么做这个任务.我该怎么做.

如果您知道,请告诉我.
谢谢.
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.


这篇关于显示GridView边界域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆