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.

Text trimming in gridControl cell / DisplayText length in pixels

Thread ID:

Created:

Updated:

Platform:

Replies:

41474 Mar 2,2006 09:14 AM Mar 3,2006 09:56 AM Windows Forms 2
loading
Tags: GridControl
dwedewdew
Asked On March 2, 2006 09:14 AM

Hi there, I implemented a virtual grid (GridControl) using Syncfusion Essential Grid v4.102.0.50. I want to show tooltips for each gridcell if the the mousepointer is hovering them AND only if the cells displayed text is trimmed to fit the cell bounds. I''m (re)setting the tooltips for each cell in the grids MouseMove event corresponding to this articel http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=67 It works fine except that I lack to see any way of getting the cells text rectangel or the text width in pixels itsself. I think I need this information to compare it with the actual cell width or column width and trigger the active-state of the tooltip. Any suggestions? Thanks! Yours Christian!

stanleyj [Syncfusion]
Replied On March 3, 2006 05:32 AM

Hi Christian, Hope this helps.. // In the GridControl''s MouseMove handler Graphics g = CreateGraphics(); GridStyleInfo style = this.gridControl1[row, col]; if( this.gridControl1.ColWidths[col] < g.MeasureString(style.Text, style.GdipFont).Width ) { this.toolTip1.SetToolTip(this.gridControl1, style.Text); this.toolTip1.Active = true; } g.Dispose(); Best regards, Stanley >Hi there, > >I implemented a virtual grid (GridControl) using Syncfusion Essential Grid v4.102.0.50. >I want to show tooltips for each gridcell if the the mousepointer is hovering them AND only if the cells displayed text is trimmed to fit the cell bounds. >I''m (re)setting the tooltips for each cell in the grids MouseMove event corresponding to this articel http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=67 > >It works fine except that I lack to see any way of getting the cells text rectangel or the text width in pixels itsself. >I think I need this information to compare it with the actual cell width or column width and trigger the active-state of the tooltip. > >Any suggestions? > >Thanks! > >Yours > >Christian!

dwedewdew
Replied On March 3, 2006 09:56 AM

Thanks a lot Stanley, that did the trick. Thanks! Yours Christian.

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.

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.

;