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
490
Background Image Problems
posted

 I have been doing some research on how to display an image in an UltraGrid cell.  In my scenario I have a bound column of Type int that represents an index into an image list.

Based on this I decided to show the image by setting the cell's background image.  I didn't want to edit the underlying data value or worry about creating a separate unbound column.  The first thing I do is set the style of my column to "Image." This hides the cell text, which is what I want... Image only. Then I set the cell.Appearance.ImageBackground and cell.SelectedAppearance.ImageBackground to the image.  At this point I have two problems that I have not been able to figure out:

1. The active row/cell ends up hiding the background image.  I can't seem to find a "cell.ActiveAppearance" object or something similar to set the image on.  How can I prevent the image from being hidden on the active row?

2. A selected row ends up putting blue highlighting in the image cell.  I can't figure out how to get rid of the highlighting.  I want the image cell to look like all of the others.

Below is a document with a screen shot of the two issues.  Row #9 is unselected and not active.  It looks ok. Row #10 is selected and you can see the blue highlighting.  Row#11 is active and you can see that the image is hidden.

Thanks!

Steve

 

Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi Steve,

    sw06226 said:
    1. The active row/cell ends up hiding the background image.  I can't seem to find a "cell.ActiveAppearance" object or something similar to set the image on.  How can I prevent the image from being hidden on the active row?

    I can't see any reason why that would happen. There's an ActiveCellAppearance on the Override, but it should not affect the background image in a cell - unless you are setting a different background image on that appearance.

    sw06226 said:
    2. A selected row ends up putting blue highlighting in the image cell.  I can't figure out how to get rid of the highlighting.  I want the image cell to look like all of the others.

    What you should probably do to get around both of these issues is set the ActiveAppearance and the SelectedAppearance on the cell to the Appearance of the cell. That way the cell will look the same in all 3 states (normal, active, and selected). You will probably need to specify a BackColor, in addition to the image on the Appearance.

     

Reply Children