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

Grid Column border not changing as expected

Thread ID:





68231 Sep 12,2007 08:58 PM UTC Sep 14,2007 02:19 AM UTC WinForms 1
Tags: GridControl
Asked On September 12, 2007 08:58 PM UTC

I have the following code that is used to changed the right border of a freeze column to a bold color. The problem I'm having is that the cell borders change as expected, except for the column header. The first line of code works, but the next two don't do anything. I haven't been able to track down any other custom code of ours that could be overriding these settings later in the code, so I'm wondering if you have any advice.

Here's the code:

//Outline frozen columns
//Any cell gridGroupingControl.TableDescriptor.Columns[_currentFreezeColName].Appearance.AnyCell.Borders.Right = new GridBorder(GridBorderStyle.Solid, Color.BlueViolet, GridBorderWeight.ExtraExtraThick);

//Any headere cell - I expected this one to work gridGroupingControl.TableDescriptor.Columns[_currentFreezeColName].Appearance.AnyHeaderCell.Borders.Right = new GridBorder(GridBorderStyle.Solid, Color.BlueViolet, GridBorderWeight.ExtraExtraThick);

//Column Header Cell - This was just something else I tried gridGroupingControl.TableDescriptor.Columns[_currentFreezeColName].Appearance.ColumnHeaderCell.Borders.Right = new GridBorder(GridBorderStyle.Solid, Color.BlueViolet, GridBorderWeight.ExtraExtraThick);

Thanks in advance,


Rajagopal [Syncfusion]
Replied On September 14, 2007 02:19 AM UTC

Hi Mark,

Thanks for your interest in Syncfusion Products.

Please try the code below in the QueryCellStyleInfo event of the GridGroupingControl. This seems to work fine.

GridTableDescriptor tableDescriptor = this.gridGroupingControl1.TableDescriptor;
if (tableDescriptor.FrozenColumn != null || tableDescriptor.FrozenColumn != string.Empty)
string colName = tableDescriptor.FrozenColumn;
if (e.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell && e.TableCellIdentity.Column != null &&
e.TableCellIdentity.Column.Name == colName)
e.Style.Borders.Right = new GridBorder(GridBorderStyle.Solid, Color.BlueViolet, GridBorderWeight.Medium);

Let me know if this helps.



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

or the page will be automatically redirected to 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