Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

DataGridView: Scrolling to Selected row

$
0
0

(.NET 2.0 Framework)
In the DataGridView control, I have programmatically selected a row that's currently not displayed in the grid.  However, the grid does not seem to scroll to the selected row automatically, and there doesn't seem to be a way to scroll programmatically to any row, let alone the selected row.

Some details:
- my DataGridView is running under VirtualMode
- I first execute DataGridView.ClearSelection() then DataGridView.Rows[index].Selected = true
- I have traced the rows that aren't displayed and the pertinent properties are:
   DataGridViewRow.Visible = true
   DataGridViewRow.Displayed = false

I see no functions under DataGridView or DataGridViewRow to force the DataGridView to force a scroll.  Can anyone confirm this?  And is there a work around?


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>