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

Discussion in 'ASP .Net Datagrid Control' started by Dan Morrow, Apr 25, 2007.

  1. Dan Morrow

    Dan Morrow Guest

    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 Morrow, Apr 25, 2007
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.