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