I have Ultragrid control, and when the mouse hover the header of the column the hint is appear with the name of the column but this with one condition that is if the column text not full appears. So my Question is :
How I can make the column hint always appear when the mouse hover of the column grid ?
Hi,
I don't think there is any way to do this, unless you turn off the built-in tooltips on the grid headers and show your own.
Why would you want to show a tooltip for text that the user can already see in full?
thanks Mr. Mike ,can you please tell me how I can built -in my own tooltips in grid column header .I will put the shortcut name to the coulmn and when mouse hove i will describe the details.
Thanks Mike,it's working .
You can assign a tooltip to the entire grid control in the same way you would for any other control. You can use the method on the inbox tooltip class or else use UltraToolTipManager.
The only tricky part is that the tooltip has to change depending on the location of the mouse within the grid, so you will have to trap MouseMove in the grid and trap for when the mouse is over a column header. This is done using the UIElements. The code would look something like this:
private void ultraGrid1_MouseMove(object sender, MouseEventArgs e) { // Get the grid UltraGrid grid = (UltraGrid)sender; // Get the last UIElement entered UIElement element = grid.DisplayLayout.UIElement.LastElementEntered; // See if the element is a HeaderUIElement HeaderUIElement headerElement = element as HeaderUIElement; // If not, then see if any of it's ancestors is a HeaderUIElement. if (headerElement == null) headerElement = element.GetAncestor(typeof(HeaderUIElement)) as HeaderUIElement; UltraGridColumn column = null; // If we found a HeaderUIElement, get the column from it. if (headerElement != null) column = headerElement.GetContext(typeof(UltraGridColumn)) as UltraGridColumn; // If we got a column, set the tooltip on the grid, otherwise clear it. // It's possible to get a HeaderUIElement without a column, because a HeaderUIElement // could represent a group or grid header. if (column != null) Debug.WriteLine(column.Key, "Assign tooltip for column"); else Debug.WriteLine("Clear grid tooltip."); }