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

Icons in Column Headers

I'm currently using a GridDataBoundGrid Control to display some information. I'm using the PrepareViewStyleInfo event (as mentioned in a previous forum posting) to replace one of the columns data with an image from an image list if the value is 1. Now I'd like to make sure that the column header for that column displays the icon. (Much like the attachment and flag columns in Outlook) What's the quickest/easiest way to do this?

2 Replies

AD Administrator Syncfusion Team April 30, 2003 08:05 AM UTC

I think you can use the same technique as other cells in the column with a couple of additional changes. You can identify the column header in PrepareViewStyleInfo by checking for e.RowIndex == 0. So, if it is the particular header you are looking for, in addition to setting the image stuff, also set e.Style.CellType = "Static" and e.Style.CellAppearance = GridCellAppearance.Raised; The raised part is what gives the cell the 3d header look. You can set this to Flat if you don't wnat this.


PH Paul Heal April 30, 2003 09:03 AM UTC

Worked like a charm. I was missing the setting of the cell type. Thanks!

Loader.
Live Chat Icon For mobile
Up arrow icon