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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

disable character spacing on changing colwidth

Thread ID:





7702 Oct 7,2003 09:09 AM UTC Oct 7,2003 11:50 AM UTC WinForms 3
Tags: GridControl
Markus Kraft
Asked On October 7, 2003 09:09 AM UTC

Hi, is it possible to turn off the character spacing (at the left or right end of the cell) when the columnwitdh is manually changed? My gridboundcolumn is initialized as follows: gbc.StyleInfo.AutoSize = false; gbc.StyleInfo.HorizontalAlignment = GridHorizontalAlignment.Left; gbc.StyleInfo.Trimming = System.Drawing.StringTrimming.Character; greetings markus

Administrator [Syncfusion]
Replied On October 7, 2003 09:47 AM UTC

Not sure if I fully understand. You could handle the ColumnResizing event and when the "reason" event argument is MouseDown set gbc.StyleInfo.TextMargins.Left = 0; gbc.StyleInfo.TextMargins.Right = 0; RefreshRange(gridRangeInfo.Col(colIndex)); Stefan

Markus Kraft
Replied On October 7, 2003 10:24 AM UTC

Hi, the attached PDF shows the problem. Any idea to turn the spacing behavor off? greetings markus

Administrator [Syncfusion]
Replied On October 7, 2003 11:50 AM UTC

This Check out the GridModel.PrepareGraphics event. It lets you customize the graphics context before a grid control draws to it. For example: e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; You should also try SingleBitPerPixel. Check out also the following article for some background information why GDI+ does render text differently depending on the text size: http://windowsforms.net/articles/gdiptext.aspx Stefan


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

This page will automatically be redirected to the 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

Live Chat Icon For mobile
Live Chat Icon