We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ColumnHeaderCell & Icon in Header Cell

Hi, I want to have an icon in a header cell plus the direction of a possible sort after clicking the header cell by using cell type ColumnHeaderCell/ GridSortColumnHeaderCellModel. If I set the CellType of the Header cell to static, it is possible to set an icon. For the sorting Icon on the right side of the header cell I have to use the cell type ColumnHeaderCell. Is there any existing code that I can use to show my Icon on the left side by having the sort direction icon on the right side? Thank you for your help. Holger

1 Reply

AD Administrator Syncfusion Team September 18, 2005 07:40 AM UTC

Hi Holger, You can achive this by custom drawing your image in the grid''s CellDrawn event handler. private void gridDataBoundGrid1_CellDrawn(object sender, GridDrawCellEventArgs e) { GridDataBoundGrid grid = sender as GridDataBoundGrid; if(grid != null && e.RowIndex ==0 && e.ColIndex > 0 && e.Style.Tag != null) { GridStaticCellRenderer.DrawImage(e.Graphics, this.imageList1, 0, e.Bounds, false); } } Here is a small sample. Best regards, Jay N

Loader.
Live Chat Icon For mobile
Up arrow icon