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

GridControl without headers

I'm using SyncFusion 5.1.0.51 and VS2005 (.NET 2.0)

I'm using a GridControl and I've removed the column headers. The problem is that the top row doesn't have a border along the top so those cell aren't closed off.

I can't set the border one the whole control since it's docked (full) on the panel behind.

Any thoughts? I can include a screen shot if that isn't clear.

Dan

1 Reply

HA haneefm Syncfusion Team May 18, 2007 07:33 AM UTC

Hi Dan,

There is no built-in support for setting the grid's borders in a GridControl. You could derive the Windows.Panel control and add a grid to it. You could set the Panel''s DockPadding.All = 1 and set the panel''s BackColor to the color you want to see. Also set the BorderStyle on both the grid and panel to none. Below is a code snippet

public class MyGridControl : Panel
{
public GridControl Grid = new GridControl();
public MyGridControl():base()
{
this.DockPadding.All = 1;
this.BackColor = Color.SlateBlue;
this.BorderStyle = BorderStyle.None;
this.Grid.Dock = DockStyle.Fill;
this.Grid.BorderStyle = BorderStyle.None;
this.Controls.Add(this.Grid);
}
}

If you want to set a row border in a grid , you can try the below code.

this.grid.Model.RowStyles[3].Borders.All = new GridBorder(GridBorderStyle.Solid);

Here is a forum thread that discuss with the different technique for drawing the borders in a grid.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=52120

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon