)
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 display placeholder characters when cell content exceeds cell width?

Platform: WinForms |
Control: GridControl |
Published Date: May 13, 2016 |
Last Revised Date: May 28, 2019

If the content of a grid cell exceeds the cell width, then characters can be displayed as placeholders instead of actual letters or numbers, indicating that the cell contains more content than can be shown within the cell. By default, the number sign (#) is used as the placeholder character, but you can specify custom characters. This article explains the usage of the placeholders.

Converting Alphabetic Content

In order to specify only alphabetic contents as placeholders, the AutoFit property can be set as Alphabet.

Code Snippet

C#

gridControl1[2, 1].AutoFit = AutoFitOptions.Alphabet;

 

VB

gridControl1(2, 1).AutoFit = AutoFitOptions.Alphabet

 

Converting Numeric Content

In order to specify the only numeric contents as placeholders, the AutoFit property can be set as Numeric value.

Code Snippet

C#

gridControl1[4, 3].AutoFit = AutoFitOptions.Numeric;

 

VB

gridControl1(4, 3).AutoFit = AutoFitOptions.Numeric

 

Converting Alphabetic and Numeric Content

In order to use both the contents of alpha-numeric contents as placeholders, the AutoFit property can be set to the value Both.

Code Snippet

C#

gridControl1[6, 3].AutoFit = AutoFitOptions.Both; 

 

VB

gridControl1(6, 3).AutoFit = AutoFitOptions.Both

 

Not Converting Content

In order to restrict display of placeholders with any of the contents, the AutoFit property can be set to the value None. By Default, the value of AutoFit property is None.

Code Snippet

C#

gridControl1[8, 6].AutoFit = AutoFitOptions.None;

 

VB

gridControl1(8, 6).AutoFit = AutoFitOptions.None

 

Setting Custom Characters

Characters other than the number sign (#), the default, can be used to replace alphanumeric content that exceeds the size of a cell. In order to do so, the AutoFitChar property can be used to set as a desired character.

C#

gridControl1[4, 6].AutoFitChar = '$';

 

VB

gridControl1(4, 6).AutoFitChar = "$"

 

Screenshot

Showing placeholder characters in GridControl

Sample links:

C# PlaceHolders_CS

VB PlaceHolders_VB

 

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