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
870
Object as cell value displaying images
posted

We have used objects as cell values to display textual values (the object exposes its own ToString method that the grid uses to obtain the value to display) and that works very well.  We change the value of some public property of the class in the underlying data and the grid updates the cell with the value returned from the ToString method.

We now want to use the same technique to display a variety of images in the cell on some value that is assigned to a property of the object.  Is this possible and if so, how?

Thanks,

Dana

Parents
  • 870
    Suggested Answer
    Offline posted

    Thank you for all the feedback.

    What we have chosen to do is use a ValueList where we set the DataValue to be the value, the Appearance.Image to be the icon for the cell for each ValueListItem and then set the DisplayStyle for the ValueList to be ValueListDisplayStyle.Picture.  The column in the underlying table has the Expression property value set to the name of the "real" value column in the table.

    This results in a read-only column in the grid that displays a different image based on the value of a column in the data source.

Reply Children