views:

52

answers:

2

I have a DataGridView bound on a generic list, in .NET 3.5.

When this grid is resized, there is a residual traces that is left behind on the background of the grid where there is no items. This only occurs where there is some columns that have the WrapMode attribute set to True. It seems that only the content that is wrapped is not refreshed on the background of the grid.

Anybody have a workaround or a resolution for this problem?

A: 

Try .Refresh() method, also set the .DoubleBuffer property to false. Or you can write code for custom painting.

KMan
I tried the Refresh method, and DoubleBuffer property, without success. Is there any alternatives to writing custom painting code for out-of-the-box behavior?
Curchy
@Curchy: How about `YourDataGridView.Invalidate();`? and `YourForm.Invalidate()`.
KMan
Tried that too... as previously mentioned, this problem only occurs when the RowHeightInfoNeeded event is handled... maybe that this could give you a hint.
Curchy
+1  A: 

I did not found any solution for that, i have a workaround by creating a custom form for edition and leave the grid read-only with one-time height adjustment.

Third-party grids should do better for this purpose.

Curchy