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.
Syncfusion Feedback

databound grid flat style

Thread ID:

Created:

Updated:

Platform:

Replies:

13448 Apr 28,2004 05:01 PM UTC Apr 29,2004 10:56 AM UTC Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On April 28, 2004 05:01 PM UTC

How do you format the whole grid so that it looks like Microsoft''s flat style? e.g. borders, cells in grid, etc Thanks.

Administrator [Syncfusion]
Replied On April 29, 2004 09:21 AM UTC

On an XP system with grid.ThemesEnabled = true, you get a ''flat'' XP look. But if this is not what you want, you will have to set particular properties to flatten different parts of teh grid. Here is a try at this. //set grid borderstyle this.gridDataBoundGrid1.BorderStyle = BorderStyle.FixedSingle; //make headers be static cells to avoid raised drawing this.gridDataBoundGrid1.BaseStylesMap["Header"].StyleInfo.CellType = "Static"; this.gridDataBoundGrid1.BaseStylesMap["Column Header"].StyleInfo.CellType = "Static"; this.gridDataBoundGrid1.BaseStylesMap["Row Header"].StyleInfo.CellType = "Static"; //set the header borders to draw GridStyleInfo style = new GridStyleInfo(); GridBorder gb = new GridBorder(GridBorderStyle.Solid, SystemColors.ControlDark); style.Borders.Bottom = gb; style.Borders.Right = gb; this.gridDataBoundGrid1.BaseStylesMap["Header"].StyleInfo.ModifyStyle(style, Syncfusion.Styles.StyleModifyType.Override); this.gridDataBoundGrid1.BaseStylesMap["Column Header"].StyleInfo.ModifyStyle(style, Syncfusion.Styles.StyleModifyType.Override); this.gridDataBoundGrid1.BaseStylesMap["Row Header"].StyleInfo.ModifyStyle(style, Syncfusion.Styles.StyleModifyType.Override); //set the borders for all non header cells... this.gridDataBoundGrid1.Model.Options.DefaultGridBorderStyle = GridBorderStyle.Solid;

Administrator [Syncfusion]
Replied On April 29, 2004 10:56 AM UTC

The code is great! Thanks for your help.

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

;