| Using DrawCell Event | To draw an image within a cell, you can handle the DrawCell event for the specific cell before drawing the image. Please refer to the below code example and sample from the given location. To draw image inside the RowHeader of the FilterRow using DrawCell event, you should handle the DrawCell event for the specific row header cell and draw the image. If you are using this solution, you should draw the entire cell’s backcolor, border line. Please refer to the below code example and sample from the given location. Code Example:
Sample Location: https://www.syncfusion.com/downloads/support/directtrac/general/ze/DrawCell444193071 UG Link : https://help.syncfusion.com/windowsforms/sfdatagrid/conditionalstyling#adding-an-image-for-a-cell | |
| Using custom RowHeaderCellRenderer | You can also draw image within the RowHeader of the FilterRow by creating a custom RowHeaderCellRenderer. If you are using this solution, you need not to draw the borderline and backcolor. It will be handled by cell renderer itself. Please refer to the below code example and sample form the given location. Code Example:
Sample Location: https://www.syncfusion.com/downloads/support/directtrac/general/ze/CustomRenderer2056835115 |
Hello, I am following your example but I don't get it working. I set a breakpoint in OnRender but it is never called.
I added the renderer via:
this.sfDataGrid.CellRenderers["RowHeader"] = new CustomRowHeaderCellRenderer(sfDataGrid);
And also tried this:
this.sfDataGrid.FilterRowCellRenderers["RowHeader"] = new CustomRowHeaderCellRenderer(sfDataGrid);
The result is the same, the renderer is not called.
Is "RowHeader" the wrong key or which keys can be used?
(Syncfusion.SfDataGrid.WinForms 26.1462.35.0)