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

Remove gridlines in header row in GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

33428 Aug 19,2005 08:06 AM Aug 23,2005 11:23 AM Windows Forms 5
loading
Tags: GridControl
Geir Aamodt
Asked On August 19, 2005 08:06 AM

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 08:36 AM

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 08:46 AM

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 07:12 AM

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 07:29 AM

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

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

Superb! Best regards, Geir

CONFIRMATION

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.

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.

;