This example shows how to create a GridView descendant that will allow displaying an image against text in cells and provide images based on the GridView data.
The resulting descendant has an additional OnSmartIconSelection event that can be used to specify the index of an image that should be displayed in each cell. The event handler receives an argument of the OnSmartIconSelectionEventArgs type for providing data related to this event:
OnSmartIconSelectionEventArgs.ImageList - gets an image source.
OnSmartIconSelectionEventArgs.ImageIndex - gets or sets the index of the image that should be displayed.
OnSmartIconSelectionEventArgs.CellInfo - gets a GridCelInfo object that represent information about current GridCell.
OnSmartIconSelectionEventArgs.IsActiveEditor - gets True value if the current GridCell is active.
You should assign the index of an image that you want to display to the OnSmartIconSelectionEventArgs.ImageIndex property.
See Also:
How to force a GridView to display images against text in specified cells or columns
How to force a TextEdit to display an image against the text
Question Comments
Added By: Tristan Hegarty at: 7/18/2014 1:39:11 AM
Hi, is there supposed to be an example for creating a GridView descendant? I tried clicking the 'Example' link on the right-hand side but this doesn't work for me. Thanks.
Added By: Jannet (DevExpress Support) at: 7/18/2014 4:04:03 AM Hello Tristan,If you are looking for an example that shows how to create a GridView descendant, please review the following threads:
How to create a GridView descendant class and register it for design-time use - KB article
How to create a GridView descendant class and register it for design-time use - Example.
As for this sample, I've fixed it. Please try to download the example and let me know your results.