Display different ToolTip message in different parts of the same DataGridView control
-
Hi, I'm trying to do this and am wondering if it is possible. I have a DataGridView control. I would like the ToolTip message to show some data (on the DataGridView itself) when the cursor is over that particular row in the control. If the cursor is out side the data rows but within the control (i.e. in the parts that have no data), I would like it to show another message. I have tried this.
private void grid_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex != -1 && ds.Information.Rows[e.RowIndex]["Value"] != null)
{
this.grid.CurrentCell.ToolTipText = ds.Information.Rows[e.RowIndex]["Value"].ToString();
}
else
{
toolTip.Show("Right-click to display menu", this.grid);
}
}What do I have to do to get it working? Thanks.
modified on Wednesday, November 26, 2008 8:55 PM