I have a virtual grid that I'm trying to get some images displaying in the row header column. I've tried a variety of ways of specifying an image list and index to this column to no avail, but the same code for the regular cells works fine.
I've tried setting up the style at the grid's creation time (my grids are created dynamically) and I've tried to specify it in the QueryCellInfo event as well. But the image is either getting lost, or not drawing for some reason. Any ideas?
The default image drawing requires either a "Static" or "TextBox" CellType. RowHeader drawing is in GridHeaderCellRenderer.OnDraw which does not handle image drawing.
So, one way you could get images in row headers is to change the celltype to Static. Here is a little code snippet that you could use in your QueryCellInfo to handle this.
Private Sub QueryCellInfo(ByVal sender As Object, ByVal e As GridQueryCellInfoEventArgs)
If e.ColIndex = 0 And e.RowIndex > 0 Then
e.Style.ImageList = Me.imageList
e.Style.CellType = "Static"
e.Style.CellAppearance = GridCellAppearance.Raised
e.Style.ImageIndex = 2
e.Handled = True