The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi -
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 -
Ivan Pelly
ADAdministrator Syncfusion Team November 18, 2002 05:14 PM UTC
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 07:05 PM UTC
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)
Thanks,
Ivan Pelly
ADAdministrator Syncfusion Team November 18, 2002 10:25 PM UTC
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.