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

Setting Cell Tool Tip via e.Inner.Style.CellTipText

I''m currently using the PrepareViewStyleInfo to set the tooltip when a user hovers over a specic column in the grid. It all works fine but I was wondering on the most effective way to do this - PrepareViewStyleInfo seems to be fired an awful lot. The tooltip never changes at runtime - it''s just calculated based on the record ID which I store in a hashtable. Is it possible to "lock" the CellTipText for a cell and only get it if it''s null? Is there a "Handled" or some sort of storage mechanism. Any help would be appreciated - excellet product so far

6 Replies

AD Administrator Syncfusion Team October 21, 2004 04:13 AM

If the tip is the same for all cells in the column, you can set this in the columns Appearance object once, say in formload, or from the designer. this.gridGroupingControl1.TableDescriptor.Columns["Col2"].Appearance.AnyRecordFieldCell.CellTipText = "the column tip"; But if the tip is to vary for cell to cell in the column, then you would have to do it in TableControlPrepareViewStyleInfo or in QueryCellStyleInfo.


JH Jason Hales October 25, 2004 02:49 AM

Thanks for your help - Jason


JB James Blibo March 8, 2007 05:48 PM

Can you bind the tooltip to the datasource in the same manner that you bind the ggc to a datasource?


AD Administrator Syncfusion Team March 9, 2007 03:34 PM

Hi James,

One way you can handle this by using QueryCellInfo event of the Grid and set the e.Style.CellTipText to underlying datasource value. Please try attached sample and let me know if this helps.

http://websamples.syncfusion.com/samples/Grid.Windows/ExtraRowHeader_GridGroupingControl/main.htm

Best Regards,
Haneef


SL SF Lee November 28, 2011 06:34 PM

Hi,

It seems the above link doesn't work. In fact the entire subdomain (http://websamples.syncfusion.com/) no longer exists. Can you please give us the new link for the sample code?

Thanks.



RB Ragamathulla B Syncfusion Team November 30, 2011 08:31 AM

Hi Sau Fan Lee,

Thanks for the update.

You can set the celltooltip text by using QueryCellInfo or PrepareViewStyleInfo event. The following code Explains the same.

//Way 1

void TableControl_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
e.Style.CellTipText = e.Style.Text;
}

//Way 2

void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
e.Style.CellTipText = e.Style.Text;
}

Please refer to the following sample link Which illustrates the same.

http://www.syncfusion.com/downloads/Support/DirectTrac/86520/AutoDelayCommonControl870491723.zip

Please let me know if you have any further concerns.

Regards,
Ragamathullah B.


Loader.
Live Chat Icon For mobile
Up arrow icon