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

Header Text EllipsisCharacter Trimming

I am having a problem getting the header text to trim using the ellipsisCharacter method. I just edited the header base style to use this trimming method in the trimming property. However when you run the app it just cuts off the header text with a character not an ellipsisCharacter when the column is resized by the user.

2 Replies

AD Administrator Syncfusion Team October 9, 2002 06:22 AM UTC

StringTrimming is not supported for CellType "Static" which is what standard column headers are. If you change the CellType to "TextBox" then you can get the trimming to work, but then (unless you want the user to be able to edit the header text), you have to prevent the cell going into edit state by handling CurrentCellStartEditing. So, to allow the header in column 2 to trim, you could use code such as: gridControl1[0,2].Text = "This is a long title"; gridControl1[0,2].WrapText = false; gridControl1[0,2].CellType = "TextBox"; gridControl1[0,2].Trimming = StringTrimming.EllipsisCharacter; gridControl1[0,2].CellAppearance = GridCellAppearance.Raised; //.... private void gridControl1_CurrentCellStartEditing(object sender, System.ComponentModel.CancelEventArgs e) { if(gridControl1.CurrentCell.RowIndex == 0) e.Cancel = true; }


RV Rachel VanWinkle October 9, 2002 10:25 AM UTC

Thanks for the help, it works like a charm! I didn't realize string trimming didn't work for static cells.

Loader.
Live Chat Icon For mobile
Up arrow icon