Articles in this section
Category / Section

How to display placeholder characters when cell content exceeds cell width?

1 min read

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

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied