how can I order the list of selected items, in the way that theyappear in the DataGrid?

D

Dan Morrow

I'm relatively new to VB programming, so please excuse my ignorance.

I'm using a DataGridView control. You can only select entire rows, not
cells. The user can select multiple cells. I'm calling "SelectedRows" to
get that selection. The problem I have is that the list of items that I
get back is not the same order as what the user sees on the screen. (In
fact, it's the exact opposite, probably by chance).

Anyway, I'd like the result returned from "SelectedRows" to be sorted in
the same way as the user sees them. So, if the user selects rows 1-5,
I'd like "SelectedRows" to return to me the rows 1 to 5, not 5 to 1.
What is the best way to accomplish this?

Thanks for any help,
-Dan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top