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

Grid Column border not changing as expected

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,

Mark

1 Reply

RA Rajagopal Syncfusion Team 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.

Regards,
Rajagopal

Loader.
Live Chat Icon For mobile
Up arrow icon