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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Icons in Column Headers

Thread ID:





4132 Apr 29,2003 09:05 PM UTC Apr 30,2003 09:03 AM UTC WinForms 2
Tags: GridControl
Paul Heal
Asked On April 29, 2003 09:05 PM UTC

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?

Administrator [Syncfusion]
Replied On 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.

Paul Heal
Replied On April 30, 2003 09:03 AM UTC

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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon