Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
440
Ultragrid, BeginUpdate() and EndUpdate() on Windows XP with a Classic Theme
posted

Hello,

I noticed something peculiar using an Ultragrid, UltraDatasource, LoadStyle.LoadOnDemand, BeginUpdate() and EndUpdate(). Under Windows 7 x86, 64, Windows 8 and Windows XP (configured with a Windows XP theme) all works smoothly.

However, under Windows 2008 (non aero theme) or Windows XP with a Classic Theme, the background flashes to black for a second using BeginUpdate() and EndUpdate(). When I leave using the two methods out of my code, the background doesn't flash and forth to black and then white. I've tested with Infragistics 2011.2 and 2012.1, both have the same behavior.

What could be the issue here?

regards,

Roel van Bueren

Parents
  • 469350
    Offline posted

    Hi Roel,

    When you call BeginUpdate on the grid, this tells the grid not to paint itself. If something invalidates the grid and forces the grid to repaint - like if you called the Refresh method, for example, then the grid would be painted and simply skip it's own internal painting logic and it would end up painting in solid block.

    So my guess is that something in Windows XP is forcibly invalidating and re-painting the grid while you are inside your BeginUpdate/EndUpdate block. There are some known differences in the way Windows XP handles painting under certain conditions. For example, when you resize a form, some O/S's will force the controls on that form to paint and others will not.

    Tracking this down will be probably be pretty difficult. It depends what exactly is happening in between the BeginUpdate and EndUpdate statements.

    If you want to try to track it down, then there are a couple of approaches you could try.

    1) Immediately before, or perhaps after, you call BeginUpdate, hook the Paint event of the grid and put a breakpoint in the event. See if it gets hit and if it does, you can look at the call stack and that might give you a clue as to what's forcing the grid to paint.

    2) Take a look at the code you are using in between BeginUpdate and EndUpdate and try commenting out parts of it to see if you can narrow down the code that is causing the flicker. The flickering may not be caused directly by this code, of course. This code could be triggering an event and that event handler code could be the cause. So you may also want to try commenting out any event handler code for your grid (and possibly other controls on the form) to see if you can narrow it down that way.

Reply Children