I would like to customize the appearance of a ToolTip used on an UltraGridCell object.
Currently, I access the tooltip through the ToolTipText property like so:
UltraGridCell cell = e.Element.GetContext(typeof(UltraGridCell)) as UltraGridCell; cell.ToolTipText = itemDesc;
How do I access the ToolTip object so I can change the appearance (such as changing the BackColor, BorderColor, FontData, etc)?
OR, it would be great if I could use the UltraToolTipManager and use SetUltraToolTip() method on the UltraGridCell, but I have not found an easy way to do this.
Hope you can help.
Hello QualicomT,
Please see my attached sample.
To customize the appearance of the ToolTip foreach UltraGridCell, please use the MouseEnterElement event and handle it like so. You can also use a creation filter that I provided, but it is optional.
private void ultraGrid1_MouseEnterElement(object sender, UIElementEventArgs e){if (e.Element is CellUIElement){info.ToolTipText = ((CellUIElement)e.Element.GetAncestor(typeof(CellUIElement))).Cell.Text; ultraToolTipManager1.DisplayStyle = ToolTipDisplayStyle.BalloonTip; ultraToolTipManager1.SetUltraToolTip(ultraGrid1, info); ultraToolTipManager1.ShowToolTip(ultraGrid1, Cursor.Position); ultraToolTipManager1.Appearance.ForeColor = Color.White; ultraToolTipManager1.Appearance.BackColor = Color.Black; ultraToolTipManager1.Appearance.BorderColor = Color.Red; } }
private
void ultraGrid1_MouseEnterElement(object sender, UIElementEventArgs e){if (e.Element is CellUIElement){info.ToolTipText = ((CellUIElement)e.Element.GetAncestor(typeof(CellUIElement))).Cell.Text;
ultraToolTipManager1.DisplayStyle = ToolTipDisplayStyle.BalloonTip;
ultraToolTipManager1.SetUltraToolTip(ultraGrid1, info);
ultraToolTipManager1.ShowToolTip(ultraGrid1, Cursor.Position);
ultraToolTipManager1.Appearance.ForeColor = Color.White;
ultraToolTipManager1.Appearance.BackColor = Color.Black;
ultraToolTipManager1.Appearance.BorderColor = Color.Red;
}
Please let me know if you have any additional questions.