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.

Disabling frozen col/rows indication

Thread ID:

Created:

Updated:

Platform:

Replies:

6679 Aug 22,2003 01:45 AM Aug 25,2003 08:04 AM Windows Forms 8
loading
Tags: GridControl
Jimmy
Asked On August 22, 2003 01:45 AM

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.

Administrator [Syncfusion]
Replied On August 22, 2003 02:00 AM

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

Jimmy
Replied On August 22, 2003 02:22 AM

Could you file that as a feature request ? Thanks.

Administrator [Syncfusion]
Replied On August 22, 2003 05:40 AM

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);
	}
}

Jimmy
Replied On August 25, 2003 02:26 AM

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); }

Jimmy
Replied On August 25, 2003 02:44 AM

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.

Administrator [Syncfusion]
Replied On August 25, 2003 03:00 AM

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()
{
	InitializeComponent();

	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;
}

Jimmy
Replied On August 25, 2003 03:31 AM

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 );

Administrator [Syncfusion]
Replied On August 25, 2003 08:04 AM

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

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.

;