Anyone,
I'm trying to add a tooltip to my ultragrid when the user hovers over a cell. My first step was to just get the tooltip to display when the user was over a cell and then I was going to check for a specific cell in the next step. I can't get the following code to work to display the cell. I have the ultraToolTipManager on the form.
My code is below. Thanks, Kris
{
// Get the cell location.
// Get a refernce to the cell.
// Make sure the mouse is over a cell.
new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("Click Button", ToolTipImage.Info, "Delete Record", DefaultableBoolean.True);
// Display the tooltip.
ultraToolTipManager.SetUltraToolTip(igrdAgentPool, tipInfo);
ultraToolTipManager.ShowToolTip(igrdAgentPool);
}
else
ultraToolTipManager.HideToolTip();
What event is this code in?
GetChildAtPoint will not work. Thie method gets a child control, but a cell is not a control. To get the cell at a particular point in the grid, you should be using the GetContext method off of the UIElement. There are lots of KB articles on this:
Knowledge Base Results - ElementFromPoint
Mike,
Thanks. The GetContext was what I was missing. I did find a lot of examples in the KB that is where I got the code I was using. Here is the code that I am using now.
Thanks a lot Kris.
// Get a refernce to the column.
// Show the tooltip only when it is over the "Delete" column.
new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("Click button to delete record.", ToolTipImage.Info, "Delete Record", DefaultableBoolean.True);
// Set the tooltip and it will be displayed automatically based on the tooltip manager settings.
//ultraToolTipManager.ShowToolTip(igrdAgentPool);