Using the KryptonDataGridView can be a little frustrating because it does flicker quite badly when you alter the contents. You can see this clearly by using the control example from the Krypton Explorer that is placed on your desktop after installing. Starting up you get the following initial view…

And when you press the button to set the cells to random colors you get this update…
![]()

The problem is the horrible flicker you get as you can see the individual cells are updated. There is not much I can do about the poor performance as this is inherent in the base DataGridView that Krypton derives from. But I have managed to get rid of the flicker so at least it gives a reasonable transition from the users perspective.
Another control that tends to show some flicker is the KryptonHeaderGroup but for different reasons. In this case you notice the bottom header shown in the wrong place for a tiny fraction of a second as the control is resized. After investigating this issue turns out to be the operating system and not Krypton.
When you resize a control the OS is bit blit moving the pixels of the control before later asking the control to repaint. This automatic bit blitting is an issue because it moves the pixels of the bottom header to a place which we do not want them. Still, I managed to create a kludge to get around this. I place a top level transparent window over the control whilst its size changes so that you cannot see this incorrect transition phase. It works fine but I am not sure if it will cause a performance issue when you have many instances on the same form. Basic testing showed it was fine but time will tell when developers use it in real scenarios.
![]()
January 4th, 2008 at 7:00 am
Yeah, I ran into the flicker as well. To fix this, I simply derived from the KryptonDataGridView and made a call to SetStyle(ControlStyles.DoubleBuffered) in the constructor. That solved my flickering issues.
How did you fix the flicker, Phil?
Now, my only qualm is the cell.ErrorText and row.ErrorText problem. I rely on the grid to show me errors with my data; the KryptonDataGridView shows the error skewed icon, and doesn’t let me hover to see the error text. If you get a chance, please consider fixing this bug next time around; I think the fix should be relatively simple.
Take care.
January 4th, 2008 at 10:14 am
Judah,
I turn the double buffering on and off during runtime by using the base.DoubleBuffered property of the control. This is because you cannot call SetStyle outside the constructor and so you must use the alternative call instead. Your solution will have the bug that when you drag the column headers to change their size it does not correctly draw the vertical sizing line. I turn the double buffering off during the resizing operation to get around this and then turn it back on again when finished.
I am aware of the error icon issues and they are in the bug database to be looked at.
January 5th, 2008 at 5:04 am
Interesting, Phil. I wasn’t aware of the resizing thing, you’re right.
Is your fix in the latest 2.7.1 release?
January 8th, 2008 at 4:42 am
[...] progress bars into data grid views requires some tricky code. The winforms data grid view has a flickering problem, basically I’m fighting the tools [...]
January 8th, 2008 at 9:52 am
Judah – No this is a recent change for the next release.