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

Formatting Grid Headers the same as databound grid

Thread ID:





13674 May 6,2004 12:11 AM UTC May 10,2004 04:45 AM UTC WinForms 4
Tags: GridControl
Damien Sawyer
Asked On May 6, 2004 12:11 AM UTC

Hi, My project uses both databoundgrids and normal grids. In the later, I use the .Rows.HeaderCount property to format the first couple of rows. These turn out shaded in a ''gradient'' that looks really good. My users want the other databound grid to look the same, but unfortunately I''m having trouble figuring out how to do it. I''ve tried .model.rows.headercount but this gives a different result. Can you please assist? Cheers DS

Administrator [Syncfusion]
Replied On May 6, 2004 05:10 AM UTC

In a GridDataBoundGrid, the ''default'' style for a column header is found in grid.BaseStyleMap["Column Header"].StyleInfo. So, you can set styles for all headers by changing that object. If you want to do something on a header cell by header cell basis, then you can handle the PrepareViewStyleInfo event and set the styles there ''on demand''. Here is a little sample.

Administrator [Syncfusion]
Replied On May 6, 2004 05:10 AM UTC

Forgot the sample. HeadersInGDBG_8898.zip

Damien Sawyer
Replied On May 9, 2004 08:52 PM UTC

Thanks Clay, that''s great. One thing however, the vertical lines between the header cells have dissappeared. Can they be brought back easily? Cheers DS

Administrator [Syncfusion]
Replied On May 10, 2004 04:45 AM UTC

Normally, the header borders are drawn becauce the default header cells are drawn with a Raised effect. So, you can get the same effect by setting style.CellAppearance = GridCellAppearance.Raised;


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