I have been reading a lot of posts pertaining to setting tooltips for a cell, however I have seen nothing that addresses, displaying tooltips based on ValueBasedAppearance.
In my scenario I am creating ValueBasedAppearences at runtime. This occurs as part of Initialization. In many cases the ValueBasedAppearence sets up the use of 1 of many images to be displayed along with the data in the cell. What I would like to do is set the tooltip of the cell based on the ValueBasedAppearence.
Is this possible?
Is there another way to do this?
HI,
Each Cell in the WinGrid has a ToolTipText.
You can set this property in the WinGrids InitializeRow event.
Here is a code snippet:
private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { int id = (int) e.Row.Cells[0].Value; switch (id) { case 1: { e.Row.Cells[0].ToolTipText = "big boss " + id; break; } case 2: { e.Row.Cells[0].ToolTipText = "2nd banana " + id; break; }
default: { e.Row.Cells[0].ToolTipText = "every body else " + id; break;
} }
Sincerely,
MattDeveloper Support Engineer
I am just following up on this forum post.
Plesae let me know if you had additional questions regarding UltraGridCell'sTooltips.
Matt
Developer Support Engineer
Matt,
Unfortunately the proposals here do not allow for this to be done dynamically.
My predicament lies in the complexity of my implementation. Basically I have a wrappered grid control that is built dynamically based on a few tables in the DB. These tables define any number of grids within the system. With in the tables I define the properties of the grid, the columns and the column properties. There are child tables that define, the filter dropdown data, the conditional appearances, conditional security, etc.
I can basically throw an instance of my grid on to a form, set some basic properties, put data into the data base, and handle a few custom events and that is it.
So basically I am looking for a way to handle this, much like I load my ValueBasedAppearances. I currently have a function that returns a IValueAppearance based on data in the DB.
Thanks
InitializeRow will fire any time any value of any field in the row changes. So if your tooltips are based on the values in the row, then Matt's suggestion should work.
The alternative would be to apply a Tooltip to the grid control itself, either using the inbox ToolTip class or the UltraToolTipManager. Then you have to change the tooltip based on the currently location of the mouse. The only slightly tricky part of this is determining which cell is currently under the mouse, and you can find code to do that here:
HOWTO:UltraWinGrid Mouse Position and Cell Identification
Just following up here.
Do you need further assistance regarding this issue.