I have an UltraGrid with cascading dropdown controls in a few columns. Depending on the value of one dropdown control, I would like to change the ToolTipText property on the next column cell in that row. I tried setting it in the UltraGrid's BeforeCellListDropDown event and below is the result.
I added a UltraToolTipManager and set the following
ruleTooltipManager.SetUltraToolTip(secondChoiceDropdown, new Infragistics.Win.UltraWinToolTip.UltraToolTipInfo("Select a Category", Infragistics.Win.ToolTipImage.None, null, Infragistics.Win.DefaultableBoolean.True));
That results in an empty tooltip bubble when hovering over the cell. In fact, there's an empty tooltip bubble when hovering over any cell.
The next method, on a cell with a dropdown control that is populated in BeforeCellListDropDown
e.Cell.Row.Cells[ColumKey].ToolTipText = "Select a Category";
Nothing happens when hovering over that cell (I had a breakpoint on that line and it hit it)
Hello Sam,
Instead of using the UltraToolTipManager, what I can suggest you is using the ToolTipText property of the UltraGridCell that you mentioned. The only difference is that it will be used inside the InitializeRow event. Each cell could be set with a specific ToolTipText and this tooltip could be based on specific value or any other information that can be obtained from the cells inside the row.
Since you mentioned using dropdowns and dynamically setting the ValueList of the second dropdown and then setting the tooltip based on the first dropdown I am attaching a small sample application that demonstrates how to achieve it with what I have explained above.
Please test the sample on your side and let me know if you have any questions.
Regards, Ivan Kitanov
DependentDropDownCellToolTip.zip
Unfortunately, setting it during InitializeRow doesn't help because the ToolTipText property needs to be set when a dropdown value in a cell is changed.
Do you think setting it on cell MouseOver would work? I can try that and have it detect the first value and set the ToolTipText property according to that. I will post the results when done.
private void gridStudents_MouseEnterElement(object sender, Infragistics.Win.UIElementEventArgs e) { // Generate custom tooltip if (e.Element.GetAncestor(typeof(CellUIElement)) != null) { m_tooltipInfo = new UltraToolTipInfo(((CellUIElement)e.Element.GetAncestor(typeof(CellUIElement))).Cell.ToolTipText, Infragistics.Win.ToolTipImage.None, null, Infragistics.Win.DefaultableBoolean.Default); ultraToolTipManager1.SetUltraToolTip(gridStudents, m_tooltipInfo); ultraToolTipManager1.ShowToolTip(gridStudents); } }