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
close icon

GCC set tooltip with cellvalue by a hidden column

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


2 Replies

AD Administrator Syncfusion Team December 14, 2007 10:35 AM UTC

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();
}
}
}





LG Lorenzo Grassi December 14, 2007 11:31 AM UTC

Great, it's what I need, thank you

LG


Loader.
Live Chat Icon For mobile
Up arrow icon