Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Ultragrid tooltip won't display first time
posted

I want to customise a tooltip depending on which rows are selected. The problem is I have to click away from the grid and then move the mouse over the selected rows for the tooltip to display. Any ideas?

private void _toolTip_Popup(object sender, PopupEventArgs e)
{
if (e.AssociatedControl != CurveGrid)
{
e.Cancel = true;
return;
}

var dates = CurveGrid.Selected.Rows.All.Cast<UltraGridRow>()?.Select(r => r.GetCellValue("Date")).OfType<DateTime>().ToList();
if (dates.Any())
{
_toolTip.Popup -=_toolTip_Popup;
_toolTip.SetToolTip(CurveGrid, $"CUSTOM TEXT GOES HERE");
_toolTip.Popup +=_toolTip_Popup;
}
else
{
e.Cancel = true;
}
}

Parents
No Data
Reply Children
No Data