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

Looking for max text length function for a cell

Thread ID:

Created:

Updated:

Platform:

Replies:

7907 Oct 14,2003 02:11 PM UTC Oct 14,2003 04:41 PM UTC WinForms 1
loading
Tags: GridControl
Tim Jackson
Asked On October 14, 2003 02:11 PM UTC

I have used several grids and one feature I found very appealing was the ability to set a max text display length for a cell. If that length was exceeded the grid would automatically truncate the display, add a '...' to the string, and set the tooltip for that cell to display the entire string. For example if the max display length for a cell was 4, the string "Syncfusion rules" would be "Sync..." and when you hovered on that cell the tooltip would display "Syncfusion rules" Does such a feature exist for this grid? Thank you in advance. Tim

Administrator [Syncfusion]
Replied On October 14, 2003 04:41 PM UTC

You can use the GridStyleInfo.Trimming property to specify whether you want to see ellipses if the string will not fit in the cell. Maybe something like this for the whole grid (or you could do it on a cell or column r row basis). this.gridDataBoundGrid1.TableStyle.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; There are a couple of ways to get the tip to show as well. One straight forward way is to use the PrepareViewStyleInfo event.
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
	e.Style.CellTipText = e.Style.Text;
}
You may want to conditionally do this based on teh length of the text.

CONFIRMATION

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

;