Category / Section
How to set AutoEllipsis mode when text exceeds width of the cell?
2 mins read
By default, when the content of the cell exceeds to the cell’s size then the text is automatically wrapped in to the next line. To show the Ellipsis word like the ‘…’ at the end of the text, the Trimming property can be set as EllipsisWord.
Code Snippet
C#
//To enable Trimming for whole grid. this.gridControl1.TableStyle.Trimming = StringTrimming.EllipsisWord; //To enable Trimming for a particular cell. this.gridControl1[rowIndex, colIndex].Trimming = StringTrimming.EllipsisWord; //To enable Trimming for a column. this.gridControl1.ColStyles[colIndex].Trimming = StringTrimming.EllipsisWord; //To enable Trimming for a row. this.gridControl1.RowStyles[rowIndex].Trimming = StringTrimming.EllipsisWord;
VB
'To enable Trimming for whole grid. Me.gridControl1.TableStyle.Trimming = StringTrimming.EllipsisWord 'To enable Trimming for a particular cell. Me.gridControl1(rowIndex, colIndex).Trimming = StringTrimming.EllipsisWord 'To enable Trimming for a column. Me.gridControl1.ColStyles(colIndex).Trimming = StringTrimming.EllipsisWord 'To enable Trimming for a row. Me.gridControl1.RowStyles(rowIndex).Trimming = StringTrimming.EllipsisWord
Sample Link: