all groups > vb.net controls > april 2007 >
You're in the

vb.net controls

group:

Deleting rows in a multiselect datagridview



Deleting rows in a multiselect datagridview Michel Vanderbeke
4/8/2007 7:44:15 PM
vb.net controls: Hello,

When I trie to delete more than one row in a multiselect Datagridview, only
one row is deeleted.
My code does not seem to work.

Dim rij As DataGridViewRow

For Each rij In dgvToegangstickets.Rows
Select Case rij.Selected
Case True
dgvToegangstickets.Rows.Remove(rij)
End Select
Next rij

Any ideas on how to adjust this code, so I can delete more than one row at
the same time?


Many thanks and greetings from Brugge (Bruges - Belgium),

Michel
Re: Deleting rows in a multiselect datagridview Daniel E. Ulfe
4/17/2007 11:56:38 AM
Use the "SelectedRows" property of the DataGridView to get access to ALL the
selected rows... and then delete them.... :)

Daniel.

[quoted text, click to view]

Re: Deleting rows in a multiselect datagridview Screaming Eagles 101
4/18/2007 12:00:00 AM
Michel,
solution already shown by Mr. Daniel.

Just wanted to say my grandfather was born in Bruges;
and we celebrated New Year's Eve there. Pretty city.
--
Filip
http://www.ww2airborne.net/
Official Site of the 101st Airborne - 463rd PFA
skype: airborne463pfa-fiwi
[It's nice to be important, but it's more important to be nice!]
----------------------------------------------------------------

"Michel Vanderbeke" <michel.vanderbeke@skynet.Be> schreef in bericht
news:12D7A5E2-8865-4F2F-B915-2FF064209DDD@microsoft.com...
[quoted text, click to view]

AddThis Social Bookmark Button