C#backgroundworker中更新datagridview出现滚动条问题
来源:互联网 发布:网络销售是什么工作啊 编辑:程序博客网 时间:2024/05/29 18:16
问题具体描述:
在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& moved)
在 System.Windows.Forms.DataGridView.ProcessDownKey(Keys keyData)
在 System.Windows.Forms.DataGridView.ProcessDataGridViewKey(KeyEventArgs e)
在 System.Windows.Forms.DataGridView.OnKeyDown(KeyEventArgs e)
在 System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
在 System.Windows.Forms.DataGridView.ProcessKeyEventArgs(Message& m)
在 System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
在 System.Windows.Forms.Control.WmKeyChar(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.DataGridView.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.Run(Form mainForm)
在 SysAnalyse.Program.Main() 位置*******:行号 275“483”的值对于“Value”无效。“Value”应介于 'minimum' 和 'maximum' 之间。参数名: Value
解决:
1、刷新闪烁,可以改为委托刷新;
2、更新完数据之后,加dataGridView1.PerformLayout(),可以解决滚动条问题。
- C#backgroundworker中更新datagridview出现滚动条问题
- C#WinForm中的dataGridView滚动条定位
- 自定义datagridview滚动条
- DataGridView 滚动条
- 解决DataGridView在多线程中无法显示滚动条的问题
- Winform中DataGridView横向拖动滚动条时闪烁问题很严重的处理办法
- 解决DataGridView在多线程中无法显示滚动条的问题
- DataGridView滚动条同步滚动
- c#中多线程写DataGridView出现滚动条导致程序卡死(无响应)的解决办法
- 线程下DataGridView循环绑定时的滚动条问题
- VS2005中滚动条问题
- 添加tabs出现两个滚动条问题
- 解决滚动条出现,页面抖动问题
- vs2010 DataGridView 没有滚动条
- datagridview 滚动条位置设置
- 浏览器窗口中出现滚动条
- JScrollPanel中水平滚动条的出现
- 框架内TreeView出现滚动条的问题(让Div出现滚动条)……
- 【Android开发—智能家居系列】(三):手机连接WIFI模块
- 延迟脚本
- &和&&、|和||的区别
- 在 ubuntu 14.04 下,配置 apache2 的虚拟主机步骤
- 为什么程序员需要关心顺序一致性(Sequential Consistency)而不是Cache一致性(Cache Coherence?)
- C#backgroundworker中更新datagridview出现滚动条问题
- Html文件基本结构
- gem5中event queue运行原理机制详细分析
- AndroidAnnotations 框架详解
- 【Android开发—智能家居系列】(四):UDP通信发送指令
- 【一步步学OpenGL 25】-《Skybox天空盒子》
- 将开源项目导入到自己工程中出现Error:(1, 1)
- Theano深度学习笔记(三)多层感知器
- linux系统磁盘分区以及建立一个swap文件增加虚拟内存