I am trying to populate data in DataGridView control. It gets populated into it. But when I try to scroll down it gives me an exception like;
Value of ‘352’ is not valid for ‘Value’. ‘Value’ should be between
‘minimum’ and ‘maximum’. Parameter name: Value
at System.Windows.Forms.ScrollBar.set_Value(Int32 value)
at System.Windows.Forms.DataGridView.ScrollRows(Int32 rowCount, Int32 deltaY, ScrollEventType scrollEventType)
at System.Windows.Forms.DataGridView.ScrollRowsByCount(Int32 rows, ScrollEventType scrollEventType)
Does anyone know how to resolve this issue ?
I am using DataSource property and not Rows.add()
Thanks in advance
It got resolved by dataGridView1.PerformLayout() after populating data.