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.

GCC set tooltip with cellvalue by a hidden column

Thread ID:

Created:

Updated:

Platform:

Replies:

70502 Dec 13,2007 09:53 AM Dec 14,2007 06:31 AM Windows Forms 2
loading
Tags: GridControl
Lorenzo Grassi
Asked On December 13, 2007 09:53 AM

I have a GGC with couple of column, one visible and one hidden. In the hidden column I have a description, and I want to set the tooltip of the visible column with the description taken from the hidden column.

I can set the tooltip on the ActivateToolTip event, but how can I get the value of the adiacent hidden cell?

There is another way to obtain a similar effect?

Thank you
LG


Administrator [Syncfusion]
Replied On December 14, 2007 05:35 AM

The grid has support for cell tips through its GridTableZCellStyleInfo.CellTip property. You can provide these tips dynamically by handling the QueryCellStyleInfo event. Here is code that displays the value of a cell Col1 one when the user hovers over a cell in Col2.

//subscribe to the event
this.gridGroupingControl1.QueryCellStyleInfo += new GridTableCellStyleInfoEventHandler(gridGroupingControl1_QueryCellStyleInfo);


//the event handler
void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.Column != null
&& e.TableCellIdentity.Column.Name == "Col2")
{
GridRecord rec = e.TableCellIdentity.DisplayElement.GetRecord() as GridRecord;
if (rec != null)
{
object val = rec.GetValue("Col1");
e.Style.CellTipText = val.ToString();
}
}
}




Lorenzo Grassi
Replied On December 14, 2007 06:31 AM

Great, it's what I need, thank you

LG


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.

;