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
950
Display tooltip with appropriate text when hover on icons in grid
posted

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?