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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridControl without headers

Thread ID:

Created:

Updated:

Platform:

Replies:

61163 May 18,2007 05:56 AM UTC May 18,2007 07:33 AM UTC WinForms 1
loading
Tags: GridControl
Dan Dorey
Asked On May 18, 2007 05:56 AM UTC

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

haneefm [Syncfusion]
Replied On 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

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.

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

;