We'd like to conditionally have an image in the column header of the GridDataBoundGrid. We tried creating a new GridBaseStyle, and setting its properties using Grid.BaseStylesMap, then applying the style to the header cell (as per the example on page 46 of gridug.pdf) but this doesn't seem to work. In particular, we want to be displaying (or not) an image in response to the user clicking in the header (as happens automatically when grid sorting is enabled).
Thanks in advance -
ADAdministrator Syncfusion Team November 18, 2002 12:14 PM
The easiest way to draw an image in a header cell is to change the celltype from Header to Static. Static cells support drawing images by including teh ImageList and ImageIndex as part of the cell style. But Header celltype does not support the ImageList & ImageIndex drawing.
If you want your header cells to have a different appearance than the default flat look, then set the style's Appearance property.
You could try appropriately setting these properties in the CellClick event, and then calling RefreshRange on the cell to make sure it gets redrawn with the new properties.
IPIvan PellyNovember 18, 2002 02:05 PM
We're currently attempting to change the celltype with the following code:
GridDataBoundGrid1(0, 10).CellType = "Static"
Should this work? (It doesn't seem to)
ADAdministrator Syncfusion Team November 18, 2002 05:25 PM
For a GridDataBoundGrid, to change individual cell properties, you will have better results using the PrepareViewStyleInfo event, and setting the e.Style with eth properties you want bases on the e.RowIndex and e.ColIndex values passed in.