Quantcast
Viewing all articles
Browse latest Browse all 27220

VS 2010 delete row in datagridview

I have a datagrid with a number of columns. One column is called ‘AwaitingPayment’ and contains a checkbox (Yes/No).
How can I delete all rows from my datagridview where checkbox is unchecked ?

I came up with the following in the Datagrid_Load procedure, but it doesn’t seem to work :

For Each row As DataGridViewRow In DataGridView1.SelectedRows

Dim AwaitingPaymentColumn As Boolean = False

If AwaitingPaymentColumn = False Then
DataGridView1.Rows.Remove(row)
End If

Next

Viewing all articles
Browse latest Browse all 27220

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>