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

XP Style on grid borders

I know that maybe this topic has been solved, but I don''t find the solution in forums or KB.
I would like my Grids to show its border with Visual Styles. Not the cells or tables, that are fine, but the entire control border. If I set it to fixed single, it appears black. The effect I want to achieve is the same that in Common Controls: the border is drawn in a blue color.
I¡ve tried overriding WndProc, and, even though I get the results, the repainting gets sometimes messed. Is there an way to do it? (I''ve cheked ThemesEnabled is set to true)

2 Replies

AD Administrator Syncfusion Team September 11, 2006 05:16 AM UTC

Hi Alejandro,

There is no built-in support for this in GridGroupingControl. 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 MyGroupingControl : Panel
{
public GridGroupingControl Grid = new GridGroupingControl();
public MyGroupingControl():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);
}
}

For more details, see the attached sample.
http://www.syncfusion.com/Support/user/uploads/GGC_b0f26025.zip

Let me know if this helps.

Best Regards,
Haneef


AS Alejandro Serrano September 12, 2006 12:43 PM UTC

Well, not much really... :-(
The reason is that SlateBlue is good when the theme is Windows XP''s Blue Theme, but when any other is set, the visual appearance is not as good.

Loader.
Live Chat Icon For mobile
Up arrow icon