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

Disabling frozen col/rows indication

If I freeze the first column and the two first rows I get some wierd blue lines. If I disable frozen the frozen cells the lines go away. See the (mangled, sorry) screenshot. How can I disable them or make them the same color as the background ? Thanks.

8 Replies

AD Administrator Syncfusion Team August 22, 2003 06:00 AM UTC

You can change the color of that line using this property, but you cannot remove it entirely. this.gridControl1.Properties.FixedLinesColor

JI Jimmy August 22, 2003 06:22 AM UTC

Could you file that as a feature request ? Thanks.

AD Administrator Syncfusion Team August 22, 2003 09:40 AM UTC

You can make this border anything you like by handling QueryCellInfo, and in the handler if e.ColIndex points to your frozen column, then set e.Style.Border.Right = new GridBorder(....); to have teh border you want to see.
private void gridControl1_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
	if(e.ColIndex == this.gridControl1.Cols.FrozenCount&& e.RowIndex > 0)
		e.Style.Borders.Right = new GridBorder(GridBorderStyle.Dotted, SystemColors.ActiveCaption);//, GridBorderWeight.Thin);

JI Jimmy August 25, 2003 06:26 AM UTC

I was able to generate some fun results using the code below. But the frozen cell lines was still drawn on top. Changing the colors to white, didn't help. I am using the wierd colors to make it clearer. See the screenshot. Also I am still on 1.5 - does the tip solve it on 1.6 ? void GridQueryCellInfo(object sender, GridQueryCellInfoEventArgs e) { if (e.RowIndex > 0 && e.ColIndex > 0) { e.Style.CellType = "Static"; if( e.ColIndex == this.gridControl1.Cols.FrozenCount ) { e.Style.Borders.Right = new GridBorder( GridBorderStyle.Solid, System.Drawing.Color.DeepPink );//, GridBorderWeight.Thin); } if( e.ColIndex == this.gridControl1.Cols.FrozenCount+1 ) { e.Style.Borders.Left = new GridBorder( GridBorderStyle.Solid, System.Drawing.Color.DeepSkyBlue );//, GridBorderWeight.Thin); } if( e.RowIndex == this.gridControl1.Rows.FrozenCount+1 ) { e.Style.Borders.Top = new GridBorder( GridBorderStyle.Solid, System.Drawing.Color.DeepPink );//, GridBorderWeight.Thin); } if( e.RowIndex == this.gridControl1.Rows.FrozenCount ) { e.Style.Borders.Bottom = new GridBorder( GridBorderStyle.Solid, System.Drawing.Color.Orange );//, GridBorderWeight.Thin); }

JI Jimmy August 25, 2003 06:44 AM UTC

Just tested -- upgrading didn't solve it. It is not a major issue (yet) since it seems that I am the only person who have noticed the glitch.

AD Administrator Syncfusion Team August 25, 2003 07:00 AM UTC

I was able to get rid of the frozen lines by turning off the gridlines, and having the cell's draw the borders. You do not have to use QueryCellInfo. Attached is a little sample. (The grid's default drawing only draws the bottom and right borders, so normally you do not have to set the top and left borders).
public Form1()

	this.gridControl1.Rows.FrozenCount = 1;
	this.gridControl1.Cols.FrozenCount = 1;

	gridControl1.TableStyle.Borders.Right = new GridBorder(gridControl1.DefaultGridBorderStyle, SystemColors.ActiveCaption);
	gridControl1.Properties.DisplayVertLines = false;

	gridControl1.TableStyle.Borders.Bottom = new GridBorder(gridControl1.DefaultGridBorderStyle, SystemColors.ActiveCaption);
	gridControl1.Properties.DisplayHorzLines = false;

JI Jimmy August 25, 2003 07:31 AM UTC

Yeah, that almost worked. Thanks. Here's some code that solves it: gridControl1.Properties.DisplayVertLines = false; gridControl1.Properties.DisplayHorzLines = false; gridControl1.TableStyle.Borders.Top = new GridBorder( GridBorderStyle.Solid, System.Drawing.Color.White ); gridControl1.TableStyle.Borders.Bottom = new GridBorder( GridBorderStyle.Solid, System.Drawing.Color.White ); gridControl1.TableStyle.Borders.Left = new GridBorder( GridBorderStyle.Solid, System.Drawing.Color.White ); gridControl1.TableStyle.Borders.Right = new GridBorder( GridBorderStyle.Solid, System.Drawing.Color.White );

AD Administrator Syncfusion Team August 25, 2003 12:04 PM UTC

I think gridControl1.TableStyle.Borders.All = GridBorder.Empty; should also work. Stefan

Live Chat Icon For mobile
Up arrow icon