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.

grid - cell editor, text "wiggling"

Thread ID:

Created:

Updated:

Platform:

Replies:

40988 Feb 18,2006 08:14 AM Mar 1,2006 08:47 AM Windows Forms 3
loading
Tags: GridControl
ralph_lachance
Asked On February 18, 2006 08:14 AM

I’m seeing some wiggling of text (a technical term…)when clicking on cell within my (vanilla) grids. I’m guessing that the renderer active during cell editing and the general cell painter are using slightly different metrics. In my case, I am using centered text alignment (both horizontal and vertical) for the cell. It looks to me as if the active cell editor/renderer is painting the baseline of the text 1 or 2 ixels higher (ie at at a lower Y coordinate) on the screen than when the when cell is not current. I''ve uploaded a screen snippet illustrating the issue; the cell in yellow is the current cell, both the visible cells have the same font and alignment settings. I should also mention this happens on two machines I work with - both are set up with "large" screen fonts. Is there anything out there that discusses the issue and/or suggests what to do about it? best regards, -Ralph

cellrendering.zip

ralph_lachance
Replied On February 18, 2006 08:17 AM

btw - I don''t mean to imply that this doesn''t happen on machines with standard screen fonts installed; frankly I haven''t tried it. Will do so if you need me to. -Ralph

Administrator [Syncfusion]
Replied On February 18, 2006 08:39 AM

Ralph, you can fine tune the metrics by handling the PrepareViewStyleInfo event and changing the style.TextMargins properties. In PrepeareViewStyleInfo you chan check whether the current cell is in edit mode using: if (Grid.CurrentCell.HasCurrentCellAt(rowIndex, colIndex) && grid.CurrentCell.IsEditing) The grid uses the same metrics for both drawing and editing but with editing what complicates the issue is that some part of the alignment is also handed off to the Win32 TEXTBOX (or RichText) control. Some things to try: - Try changing style.TextMargins as discussed above. - Try using the "OriginalTextBox" celltype instead of cell type (you can also force this for all cells and derived cell types by setting Model.Option.UseRightToLeftCompatibleTextBox = true) - Try using GDI drawing. The WIn32 control editors use GDI while the grid uses GDI+ for drawing, so the font will look a bit different when editing. You can have the grid render with win32 gdi drawing by handling the DrawCellDisplayText event: void Grid_DrawCellDisplayText(object sender, GridDrawCellDisplayTextEventArgs e) { e.Cancel = GridGdiPaint.Instance.DrawText(e.Graphics, e.DisplayText, e.TextRectangle, e.Style, true); } Stefan

ralph_lachance
Replied On March 1, 2006 08:47 AM

Thanks, I''ll try your suggestions.

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.

;