Hi.
My aim is to show the appropriate tooltip text when user mouse hover on icons in the grid.
I am binding the data as below.
IEnumerable filteredResult = (from list in result select new { Stutus = GetStatusIcon(list), Owner = list.Owner, }).ToList();
ultraGrid1.SetDataBinding(filteredResult, null, true));
private object GetStatusIcon(object list) { if (list.cond1 == true) return imageList1.Images[0]; else if (list.cond2 == true) return imageList1.Images[1]; else if (list.cond2 == true && (list.cond1 == true) return imageList1.Images[2]; return null; }
private void ultraGrid1_MouseEnterElement(object sender, UIElementEventArgs e) { if (e.Element is CellUIElement) { CellUIElement cellUIElement = e.Element as CellUIElement; if (cellUIElement.Cell.Value != null && cellUIElement.Cell.Value.GetType().FullName == "System.Drawing.Bitmap") { cellUIElement.Cell.ToolTipText = cellUIElement.Cell.Column.Header.Caption; } } }
The above code is displaying the tooltip text as column name but I want to display the image name.
I tried setiing image.Tag but it is coming as null.
Is there anyway I can solve this issue?
Hi Rajesh,
I'm not sure what you are asking, then. You would need some way to identify an image in code. I know of no way to do that. Images do not have names, as I said.
Mike!
My question was how can I display the the tooltip text based on Image. All Images are not same for a given column.
I think you understood what I am expecting.
Thanks
Rajesh...
I don't understand your question. What do you mean by Image name? Images don't have names that I am aware of.