We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Cell Draw

Thread ID:

Created:

Updated:

Platform:

Replies:

13230 Apr 23,2004 06:07 AM Jun 21,2005 01:14 PM Windows Forms 7
loading
Tags: GridControl
Steve
Asked On April 23, 2004 06:07 AM

Using the Floating cells example shipped with Syncfusion, goto a cell and hold down the i key to enter text that spans 3 cells. Press enter and you will notice that the leftmost i''s are closer togethor than the rightmost. The same occurs for other lowercase letters. This possibliy may be a GDI+ issue. Any ideas on how to work-around? (I''m using 1.8*). Thanks, Steve

Administrator [Syncfusion]
Replied On April 23, 2004 08:31 AM

This is a GDI+ issue. You can try using the TextRenderingHint to see if one of its settings will give you the look you want. You can do this by handling the PrepareGraphics event. (the AntiAlias is probably what you could use, but it may affect the look of your font.) Below are some code snippets. In 2.0, you can tell the grid to use GDI to draw the text, and that would avoid this problem as well.
Private Sub grd_PrepareGraphics(ByVal sender As Object, ByVal e As GraphicsEventArgs)
        ’ok: e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit
        ’ok: e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias
        ’wrong: e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit
        ’wrong: e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit
        ’wrong if cleartype is disable, ok if cleartype is enabled in system settings: e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault
        e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixel
End Sub ’gridControl1_PrepareGraphics 

Administrator [Syncfusion]
Replied On August 31, 2004 01:25 PM

How can I tell the grid to use GDI to draw. I''m currently using 2.1.0.9. Or any other work-around would be helpful. Thanks, Steve

Administrator [Syncfusion]
Replied On August 31, 2004 02:52 PM

You use the DrawCellDisplayText event. Take a look at the Grid\Samples\Performance\RefreshGrid sample.

Administrator [Syncfusion]
Replied On September 2, 2004 09:04 AM

Thanks Clay. Any change you know of an corresponding measure string that goes along with this draw? Thanks

Administrator [Syncfusion]
Replied On September 2, 2004 10:08 AM

I think you would have to use interop to access GetTextMetrics in Gdi32.lib to get the size of a string using GDI.

Steve
Replied On June 21, 2005 12:24 PM

Hi Clay, It''s my understanding that you are developing in the 2nd version of the CLR, currently in beta. I am curious to know if this GDI+ issue has been fixed in version 2 of the CLR. We have found that using GDI interface exposed by the grid is slower than using GDI+, so we are interested in using GDI+, in the upcoming release of MSFT DotNet. Thanks, Steve

Administrator [Syncfusion]
Replied On June 21, 2005 01:14 PM

This anti-aliasing support is still in .NET 2.0. You still see the letters bunch up as you type longer and longer strings.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;