DataGridView.SelectAll() doesn't select all.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Eek
    New Member
    • Apr 2008
    • 1

    DataGridView.SelectAll() doesn't select all.

    Hi everyone;

    I have a strange problem with a DataGridView bound to a BindingList. The grid is populated asynchronously by a thread which, when it completes, refreshes the grid by doing an Invoke on it, settings its DataSource to the new BindingList.

    This works find and the list is clearly populated. However, when I press my Select All button, only the first element in the grid is populated. If I invoke SelectAll twice in a row, it works. Huh?

    I've tried breaking just before the SelectAll invocation, and the grid's rowcount does reflect the new datasource. However, after the SelectAll invocation, the SelectedRows count is 1 and not the number of elements in the grid.

    I'm at a loss to explain this. Has anyone here seen anything like this?

    Thanks in advance.
  • ShahbazAshraf
    New Member
    • Mar 2008
    • 36

    #2
    I think u have forget to call the method bindgrid() after this statement

    DataGridView.se lectall()
    bindgrid() // Method that bind the data

    since its necessary for datagridview to bind data in each server call. Try this ...

    Comment

    Working...