Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB 2008  - Delete all DataGridView records at once

Posted on 2009-07-09
3
Medium Priority
?
370 Views
Last Modified: 2012-05-07
Here is what I want to do (but don't know how to do it!)  Maybe it can't be done this way.  The grid contains Bound data.

    Private Sub cmdDeleteAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDeleteAll.Click

        EvalItemsDataGridView.SelectAll()
        'Call BindingNavigatorDeleteItem_Click()
    End Sub
0
Comment
Question by:ljcor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
shahprabal earned 2000 total points
ID: 24816206
delete all the records in the underlying datatable (assuming thats what your datagridview is bound to).
for each targetRow as datarow in reportdataset.tables("table1").rows
targetRow.delete
next

 
0
 

Author Closing Comment

by:ljcor
ID: 31601721
Nice and neat - short and sweet; that's what I wanted.  Thanks greatly.
0
 
LVL 14

Expert Comment

by:shahprabal
ID: 24816255
Glad I could help.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question