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
285
Can't get a grid to resize it's cells after changing DrawUtility.UseGDIPlusTextRendering
posted

I recently changed the default text rendering mode to GDI but I want to provide a user option to toggle it in case any users complain

Changing the mode does immediately update the text displayed in the cells correctly, but not the cell dimensions - the GDI+ version of the font is taller and slightly less wide. If the grid is recreated with the new setting it is very noticeably a different size.

However I can't force the grid to recalculate the size of the cells using the new text mode, I've tried various combinations of:

grid.DisplayLayout.UIElement.Invalidate(True)
grid.DisplayLayout.UIElement.DirtyChildElements()
grid.DisplayLayout.UIElement.VerifyChildElements(True)
grid.DisplayLayout.UIElement.ChildElements.Clear()
grid.DisplayLayout.UIElement.Dispose()
grid.Invalidate(True)  

All to no avail, the cells always remain the same size.

Also I concur with previous posts about how rubbish GDI+ looks (how on earth does the same font + size draw differently), even the infragistics menus look different from every other windows app because of this, and the ridiculous switching between edit mode means I have to disable it for everything.

thanks

    Martin