DataGridView vertical scrollbar not updating properly (Forms bug?)

后端 未结 14 1748
伪装坚强ぢ
伪装坚强ぢ 2021-01-03 23:49

I\'ve encountered a bug (I assume) in .NET 3.5. When adding rows to a DataGridView using Rows.Add(), while the DGV is disabled, the vertical scrollbar doesn\'t update proper

14条回答
  •  走了就别回头了
    2021-01-04 00:09

    This also solved the problem for me:

    DataGridView.SuspendLayout();
    DataGridView.ResumeLayout();
    

    It can be called before the DGV is re-enabled.


    UPDATE: This also does the job:

    DataGridView.PerformLayout();
    

提交回复
热议问题