Solved

VB 2008  - Delete all DataGridView records at once

Posted on 2009-07-09
3
368 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 500 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

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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