I have recieved the following email from one of our users, and was wondering whether anyone thought this were a feasible suggestion to fit into an UltraGrid, and if so how would you go about fitting this into the scrolling / painting mechanism used by the UltraGrid?
"i was just wondering if you could get a rendering speed up on the main bug listview by using a P/Invoke call to the Win32 ScrollWindowEx() function to scroll the screen then only render the small amount that's necessary?something like this should do the trick: [DllImport("user32.dll")] public static extern int ScrollWindowEx(IntPtr hWnd, int dx, int dy, IntPtr scrollRect, IntPtr clipRect, IntPtr hrgn, ref Rect updateRect, uint flags);then you can call ScrollWindowEx() with the listview 'Handle' to scroll the window up and draw the small amount at the bottom that needs rendering."
Thanks
Chris
Sorry - I may have posted slightly prematurely. From digging through the source I see that UltraControlBase contains a method ScrollControl(...) which is a wrapper around the native ShowWindowEx(...).
This has the summary below:
/// <summary> /// Will call ther native windows ScvrollWindowEx api if the caller /// has securoty permissions to call unmanaged code. If not this /// method will just invalidate the control. /// </summary>
Internally the grid also seems to call the static method DrawUtility.ScrollControl which seems to do the same thing.
So I guess my question is: Is it safe to assume that the UltraGrid is already using ShowWindowEx where possible? ie If the user has permissions to call / execute unmanaged code.
Thanks,
Yes, the grid already uses ScrollWindow when it can. There are some cases where it cannot do so even when it does have unmanaged code rights, such as when the grid itself has a background image applied or when alpha blending is used. But those are unusual cases.