如何清除gridview行不删除数据库中的数据 [英] how to clear gridview rows not deleting data in database

查看:67
本文介绍了如何清除gridview行不删除数据库中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在gridview中有采购订单表格。在gridview中找到数据并查找总计和编辑,删除按钮我也有。在找到格式后,gridview行显示为另一个采购订单清除。这是我的问题/ plz帮助我....提前感谢

I have purchase order form in gridview.add the data in gridview and find grand total and edit,delete button also i have.after finding grandtotal,gridview rows show be cleared for another purchase order.this is my question/plz help me....thanks in advance

推荐答案

要清除gridview中的行,您可以使用此代码..





For clearing the rows in the gridview you can use this code..


protected void btnClearRows_Click(object sender, EventArgs e)
       {
           GridView1.DataSource = null;
           GridView1.DataBind();
       }


YourGridView.DataSource = null;
YourGridView.DataBind();


这篇关于如何清除gridview行不删除数据库中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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