DataGridView vertical scrollbar not updating properly (Forms bug?)

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

    As the slider was not sizing correctly and took up most of the vertical scrollbar my solution was -

    DGV.height = DGV.Height + 1

    DGV.Height = DGV.Height - 1

    Then the slider was correctly sized

    But I now use

    DGV.PerformLayout

    which also solves the problem

    0 讨论(0)
  • 2021-01-04 00:20

    I would like to add a comment to the original post, but I can't yet (lower than 50 reputation).

    I have encountered the same problem on deleting rows. The scrollbar looks like disabled, no slider is visible and the arrows are grey.
    Will try the workarounds described here and at this link (explicitly enable the scrollbars again) or simply keep the whole DGV enabled.
    Also, this link suggests the same workaround (explicitly enabling...) and calls it working.

    0 讨论(0)
提交回复
热议问题