gridview的差异清除功能
GridView1.DataSource = null;
GridView1.DataBind();
我想知道
GridView1.Clear();
GridView的两个函数 的区别GridView1.Clear() 和 GridView1.DataSource = null。我没有清除 GridView1.Clear() 语法的错误。
Public Sub Clear()
Data.Dispose()
Data = New DataSet
MyBase.DataSource = Nothing
End Sub
我写了一个新的gridview类继承System.Windows.Forms.DataGridView.Vb类,在它的类中调用了我的clear函数。抱歉,gridview.Clear()没有。
How can I clear data in a GridView? is appeared
GridView1.DataSource = null;
GridView1.DataBind();
I want to Know difference of
GridView1.Clear();
two function of GridView1.Clear() and GridView1.DataSource = null.I have no error which clear of syntax of GridView1.Clear().
Public Sub Clear()
Data.Dispose()
Data = New DataSet
MyBase.DataSource = Nothing
End Sub
I wrote new class of gridview Inherits System.Windows.Forms.DataGridView.Vb class called my clear function in its class.Sorry,gridview.Clear() is not have.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我没有看到 GridView 方法。
如果您想清除 GridView 中的当前行,上面链接的答案就是执行此操作的方法:
如果上述方法不适合您,请使用代码更新您的问题以及您遇到的错误(如果有)正在看到。
I don't see any Clear() method listed for GridView Methods.
If you want to clear the current rows in a GridView, the answer you linked to above is the way to do it:
If the above isn't working for you, please update your question with the code and what error, if any, you're seeing.
如果你想删除gridview的行
你可以使用这个:
Gridview1.Rows.Clear();
If you want to delete the rows of a gridview
you can use this:
Gridview1.Rows.Clear();