So I have a DataGridView with 56 rows of data in it. When I select any row, then scroll it off the screen and then back on again, the original data from the selected row becomes merged with the data of another row - seems to depend on whether I scroll up/down or use scrollbar or mouse wheel (I suspect pgUp/Down and arrow keys will have a similar effect also). Searching the web only produced one result of a similar situation when the user scrolled horizontally... it was suggested he use Double Buffering, but the Reflection based code only caused my selected row to turn totally black:
Imports System.Reflection
Module DataGridViewExtensions
<System.Diagnostics.DebuggerStepThrough()> _
<System.Runtime.CompilerServices.Extension()> _
Public Sub DoubleBuffered(ByVal sender As DataGridView, ByVal Setting As Boolean)
Dim dgvType As Type = sender.[GetType]()
Dim pi As PropertyInfo = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance Or BindingFlags.NonPublic)
pi.SetValue(sender, Setting, Nothing)
End Sub
End Module
I have tried setting the DGV VirtualMode to true and false and neither makes a difference. Any insight would be great!