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.
    Dan Morrow, Apr 25, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bart Van Hemelen
    Replies:
    2
    Views:
    4,668
    Bart Van Hemelen
    Sep 4, 2006
  2. Iain
    Replies:
    3
    Views:
    929
  3. Anjan Bhowmik
    Replies:
    1
    Views:
    472
    Misbah Arefin
    Feb 14, 2008
  4. mldardy
    Replies:
    1
    Views:
    751
    mldardy
    Dec 10, 2008
  5. Henrik
    Replies:
    1
    Views:
    424
    Ken Cox [Microsoft MVP]
    Jul 6, 2006
Loading...

Share This Page