Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Datagridview error : Value' should be between 'minimum' and 'maximum'


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

like image 389
Vijay Balkawade Avatar asked Aug 11 '26 12:08

Vijay Balkawade


1 Answers

It got resolved by dataGridView1.PerformLayout() after populating data.

like image 96
Vijay Balkawade Avatar answered Aug 13 '26 04:08

Vijay Balkawade



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!