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

databound grid flat style

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

2 Replies

AD Administrator Syncfusion Team 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;


AD Administrator Syncfusion Team April 29, 2004 10:56 AM UTC

The code is great! Thanks for your help.

Loader.
Up arrow icon