DataGridView vertical scrollbar not updating properly (Forms bug?)

后端 未结 14 1900
伪装坚强ぢ
伪装坚强ぢ 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:06

    I had this problem too. It seems to be related to having the table embedded in a TabPage.

    I tried all of the other answers in turn. The solution that ultimately worked for me was to do the following after adding all the rows/updating the table.

    this.Height -= 5;
    this.PerformLayout();
    this.Height += 5;
    this.PerformLayout();
    

    This is in my own modified DataGridView class (hence the use of "this"). You'd just substitute the name of your DataGridView.

提交回复
热议问题