Datagridview行绘画表现异常 [英] Datagridview row painting behaves abnormally

查看:77
本文介绍了Datagridview行绘画表现异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的表单上有一个DataGridView,它是简单的.net winform控件(不是自定义的)。

就在网格上方,我有一个Combobox控件。



Grid填充了一些绑定到BindingSource的数据。



当用户展开组合框时,并选择一个项目,可见的组合框列表消失。此时,组合框列表的快照仍保留在DataGridView的顶行上。



我不知道这些信息是否足以描述该问题。我没有找到附加表单快照的选项,因此问题会更加明确。如果codeproject上有任何这样的选项,请告诉我,我会上传快照。



此外,它在一小时前完美运行。



我尝试过:



1.尝试调试DataGridView的绘画事件,但是发现没有问题。

2.将double buffered设置为true,但没有帮助。

3.重置附加到datagridview的绑定源,再次没有帮助。

I have a DataGridView on my form which is plain .net winform control (not customized).
Just above the grid I have a Combobox control.

Grid is populated with some data bound to a BindingSource.

When user expand the combo-box, and selects an item, the visible combo-box list disappears. At this point, a snapshot of combo-box list remains painted on top row in DataGridView.

I don't know if this information is enough to describe the issue. I am not finding an option to attach snapshots of the form, so that problem would be more clear. If any such option is available on codeproject, please let me know, I will upload the snaps.

Also, it was working perfectly just an hour ago.

What I have tried:

1. Tried debugging DataGridView's painting event, but found no issues.
2. Set double buffered to true, but no help.
3. Reset binding source attached to datagridview, again no help.

推荐答案

检查你的DGV的各种油漆事件处理程序 - 我不知道你正在处理哪些,但是有很多候选人。



除非油漆处理程序中有错误,否则我从未见过DGV乱搞和外部控制。
Check the various paint event handlers for your DGV - I have no idea which ones you are handling, but there are quite a few candidates.

I've never seen a DGV messed up by and external control unless there is a mistake in a paint handler.


这篇关于Datagridview行绘画表现异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆