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
SIGN IN To post a reply.
6 Replies
AD
Administrator
Syncfusion Team
October 21, 2004 08:13 AM UTC
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 06:49 AM UTC
Thanks for your help - Jason
JB
James Blibo
March 8, 2007 10:48 PM UTC
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 08:34 PM UTC
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
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 11:34 PM UTC
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.
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 01:31 PM UTC
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.
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.
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.
SIGN IN To post a reply.
- 6 Replies
- 5 Participants
-
JH Jason Hales
- Oct 21, 2004 07:25 AM UTC
- Nov 30, 2011 01:31 PM UTC