Hi,
Problem is that after 5 second tooltip is hidden and if i have set time 30 sec for tooltip then next ultragrid cell tooltip is not updated as per mouse move.
My Code is here:
void _Grid_MouseEnterElement(object sender, UIElementEventArgs e)
{
UltraGridCell cell = e.Element.GetContext(typeof(UltraGridCell)) as UltraGridCell;
UltraToolTipInfo utti = _toolTipManager.GetUltraToolTip(m_grid);
if (cell != null)
utti.ToolTipText = cell.Text;
}else
utti.ToolTipText = string.Empty;
}
OR
I have tried below code also;
Point prevCellPoint = Point.Empty;
void Grid_MouseMove(object sender, MouseEventArgs e)
UltraGrid grid = sender as UltraGrid;
UltraToolTipManager _toolTipManager = new UltraToolTipManager();
UltraToolTipInfo utti = _toolTipManager.GetUltraToolTip(grid);
utti.ToolTipText =
string.Empty;
Point screenpoint = Control.MousePosition;
Point clientpoint = grid.PointToClient(screenpoint);
Infragistics.Win.
UIElement uiElement = m_grid.DisplayLayout.UIElement.ElementFromPoint(clientpoint);
UltraGridCell cell = uiElement.GetContext(typeof(UltraGridCell)) as Infragistics.Win.UltraWinGrid.UltraGridCell;
if (prevCellPoint != clientpoint)
//_toolTip.SetToolTip(grid, cell.Text);
prevCellPoint = clientpoint;
else
Please suggest
Hi Priyanka,
Thank you for posting in our forums.
Can you please clarify your requirements? How long do you want the tooltips to be shown? Do you want the tooltips to appear permanently for each cell the mouse passes through? Please describe what your goal is and I will be glad to help you implement it.
I am looking forward to hearing from you.
I want the tooltips to appear permanently for each cell the mouse passes through.
So i used below code:
UltraToolTipManager _utoolTipManager =new UltraToolTipManager();
_utoolTipManager.AutoPopDelay = 0;
And it is working.
When "Content is wider than the cell then Tooltips are automatically displayed in this situation."
So my question is that "How to hide these automatically displayed tooltip for that cell?"
Please suggest earlier.
Tooltips are control-based. In other words, the tooltip displays when the mouse enters a control and hovers over that control for a certain length of time. Moving the mouse within a control will not cause the tooltip to close/re-show. This is true of any control.So you can't rely on the default behavior that shows the tooltip in this case.
So if you want the tooltip to constantly update as the mouse moves over cells in a grid, then you would need to call the show method to show a new tooltip each time the mouse enters a new cell. You will probably also need to hide the tooltip when them mouse moves outside of any cell. So a good place to handle this might be the MouseEnterElement/MouseLeaveElement events of the grid.
Here's a link to a KB article about how to identify the cell under the mouse.
My requirement was The tool tip will close when the user moves their mouse away from the row.so used below code
Using above code tooltip set as infinite.because i want infinite tooltip until user not move mouse.
But now my problem is when user move mouse then ultragrid cell tooltip is not updated.
Can you please suggest.
Thanks,
Priyanka
Hello Priyanka,
I am just checking about the progress of this issue. Let me know if Dimitar's suggestion worked for you or if you need our further assistance.
Thank you for using Infragistics Components.
Thank you for the reply.
You can hide the tooltip by calling the HideTooltip method of the UltraTooltipManager. This can be done in the MouseEnterElement event, by checking if the element is HeaderUIElement and using the HideTooltip method if it is.
I have attached a modified version of the sample demonstrating this approach.
Please let me know if you have any additional questions.
Automatically Tooltip displayed problem is solved using UltraGrid property.
Now my question is that When I move mouse from GridCell to GridHeader then GridHeader display previous GridCell tooltip text.
Please suggest how to clear Tooltip Text on GridHeader when i move mouse from previous GridCell to GridHeader?