)
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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to avoid text cut off while BorderMargins are using in WinForms GridControl or GridGroupingControl?

Platform: WinForms |
Control: GridControl |
Published Date: September 2, 2015 |
Last Revised Date: February 11, 2020
Tags: styling

Avoid the text cutoff while border margin using in grid

Problem:

When the border margin size is more than the text size, the text is cut off on display.

The following image shows the text cut off.

Show the cut off text

Figure 1: Text cut off

Solution:

To avoid this problem of the text being cut off, use the Font.Unit property in the QueryCellStyleInfo event, and set the value to GraphicsUnit.World.

C#

grid.QueryCellStyleInfo+=new GridTableCellStyleInfoEventHandler(grid_QueryCellStyleInfo);
e.Style.Font.Unit = GraphicsUnit.World;

VB

AddHandler grid.QueryCellStyleInfo, AddressOf grid_QueryCellStyleInfo
e.Style.Font.Unit = GraphicsUnit.World

After applying the properties, the Grid is displayed as follows.

Show grid with applied properties

Figure 2: Grid with applied properties

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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