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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

grid - cell editor, text "wiggling"

Thread ID:





40988 Feb 18,2006 01:14 PM UTC Mar 1,2006 01:47 PM UTC WinForms 3
Tags: GridControl
Asked On February 18, 2006 01:14 PM UTC

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


Replied On February 18, 2006 01:17 PM UTC

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 01:39 PM UTC

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

Replied On March 1, 2006 01:47 PM UTC

Thanks, I''ll try your suggestions.


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon