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

Header Text EllipsisCharacter Trimming

Thread ID:





1258 Oct 8,2002 01:51 PM Oct 9,2002 06:25 AM Windows Forms 2
Tags: GridControl
Rachel VanWinkle
Asked On October 8, 2002 01:51 PM

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.

Administrator [Syncfusion]
Replied On October 9, 2002 02:22 AM

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; }

Rachel VanWinkle
Replied On October 9, 2002 06:25 AM

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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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