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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Remove gridlines in header row in GridControl

Thread ID:





33428 Aug 19,2005 12:06 PM UTC Aug 23,2005 03:23 PM UTC WinForms 5
Tags: GridControl
Geir Aamodt
Asked On August 19, 2005 12:06 PM UTC

I have been poking around the GridControl settings too many hours know and probably gone blind... I''m not able to find the setting where I: 1. Can turn on/off grid lines in the header 2. Adjust the color in the grid lines (when turned on) Best regards, Geir

Administrator [Syncfusion]
Replied On August 19, 2005 12:36 PM UTC

Two things that make headers special and so required special code to handle. One is that if you are using themed headers, then the header are drawn using the theme from your OS, and so you have no control over colors or lines or anything. The second is that the default headers take their style objects from case styles, grid.BaseStylesMap["Column Header"].StyleInfo. So, to change the styles of headers, you should change this style object. So, for example, grid.BaseStylesMap["Column Header"].StyleInfo.ThemesEnabled = false will turn off themed drawing for the headers and allow themes to be used elsewhere in teh grid. By default, a header uses style.CellType = "Header". With this celltyle, the raised appearance is done directly in the renderer and this is what gives the headers lines. Try this code. GridStyleInfo style = this.gridControl1.BaseStylesMap["Column Header"].StyleInfo; style.CellType = "Static"; style.BackColor = Color.Red; The "Row Header" base style controls the look of teh row headers, and the "Header" base style controls the top-left cell.

Administrator [Syncfusion]
Replied On August 19, 2005 12:46 PM UTC

This KB may be helpful. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=57 To color a border, use: style.Borders.Right = new GridBorder(GridBorderStyle.Solid, Color.Blue);

Administrator [Syncfusion]
Replied On August 23, 2005 11:12 AM UTC

Great stuff Clay, works like a charm! One final follow up, when selecting a cell, i get a borders around the cell, do you have a tip on how to remove this border? Best regards, Geir

Administrator [Syncfusion]
Replied On August 23, 2005 11:29 AM UTC

If you never want to see the border, try settting: grid.ShowCurrentCellBorderBehavior = GridShowCurrentCellBorder.HideAlways;

Administrator [Syncfusion]
Replied On August 23, 2005 03:23 PM UTC

Superb! Best regards, Geir


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