问题具体描述:
在backgroundworder_complete中更新datagridview的数据,出现以下问题:
1、页面不停闪烁;
2、滚动条无法拖动至最下面一条数据,用键盘一行行往下推,到某一行崩溃,出现如下描述的错误
在 System.Windows.Forms.ScrollBar.set_Value(Int32 value)
在 System.Windows.Forms.DataGridView.ScrollRows(Int32 rowCount, Int32 deltaY, ScrollEventType scrollEventType)
在 System.Windows.Forms.DataGridView.ScrollRowsByCount(Int32 rows, ScrollEventType scrollEventType)
在 System.Windows.Forms.DataGridView.ScrollRowIntoView(Int32 columnIndex, Int32 rowIndex, Boolean committed, Boolean forCurrentCellChange)
在 System.Windows.Forms.DataGridView.ScrollIntoView(Int32 columnIndex, Int32 rowIndex, Boolean forCurrentCellChange)
在 System.Windows.Forms.DataGridView.ProcessDownKeyInternal(Keys keyData, Boolean& mo

在使用BackgroundWorker完成数据更新时,遇到DataGridView页面闪烁和滚动条异常问题,导致无法滚动到底部。错误发生在ScrollBar.set_Value方法中。解决办法包括:1) 使用委托刷新防止闪烁;2) 更新数据后调用dataGridView1.PerformLayout()来修复滚动条问题。
最低0.47元/天 解锁文章
2617

被折叠的 条评论
为什么被折叠?



