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

GroupingGrid border colors

Hi, How do I do the following layout? I''d like to have a black border around the entire groupinggrid control. Next, I''d like to have a gray line between each row and column EXCEPT in the column header...no vertical lines between the column headers.

5 Replies

AD Administrator Syncfusion Team October 15, 2004 06:22 PM

Try setting these properties. this.ggc.TableDescriptor.Appearance.AnyCell.Borders.Bottom = new GridBorder(GridBorderStyle.Solid, Color.Gray, GridBorderWeight.Thin); this.ggc.TableDescriptor.Appearance.AnyCell.Borders.Right = new GridBorder(GridBorderStyle.Solid, Color.Gray, GridBorderWeight.Thin); this.ggc.TableDescriptor.Appearance.AnyHeaderCell.Borders.Right = new GridBorder(GridBorderStyle.None);//, Color.Gray, GridBorderWeight.Thin); this.ggc.TableDescriptor.Appearance.RecordRowHeaderCell.Borders.Right = new GridBorder(GridBorderStyle.Solid, Color.Gray, GridBorderWeight.Thin); this.ggc.TableDescriptor.Appearance.AlternateRecordRowHeaderCell.Borders.Right = new GridBorder(GridBorderStyle.Solid, Color.Gray, GridBorderWeight.Thin); this.ggc.TableDescriptor.Appearance.AddNewRecordRowHeaderCell.Borders.Right = new GridBorder(GridBorderStyle.Solid, Color.Gray, GridBorderWeight.Thin); this.ggc.TableDescriptor.Appearance.AnyHeaderCell.CellType = "Static"; //GridTableDescriptor td = this.ggc.TableDescriptor; //td.Columns[td.VisibleColumns[td.VisibleColumns.Count-1].Name].Appearance.ColumnHeaderCell.Borders.Right = new GridBorder(GridBorderStyle.Solid, Color.Black, GridBorderWeight.Thin); this.ggc.ThemesEnabled = false; this.ggc.BorderStyle = BorderStyle.FixedSingle;


AD Administrator Syncfusion Team October 19, 2004 05:37 AM

Hi Clay, While that piece of code did do what I requested, it does introduce one problem. The sort indicator (up/down arrow head) in the column no longer appears. Can this be fixed? Also, is there a property to set the gridgrouping control''s border color. I can''t seem to find one and the default is black. How can it make it blue?


AD Administrator Syncfusion Team October 19, 2004 06:24 AM

The reason the sort indicator is gone is because of the "Static" setting. Our sort indicator column header cell derives from teh statndard header cell. And this cell does not use borders, but instead draws itself raised for a better ''header type'' effect. So, to be able to remove the border, you have to not use a header cell (hence the change to Static). But this does remove support for the sort indicator. There is no property setting that will allow you to get both no header border and the sort bitmap. One thing you can do is to handle the TableControlCellDrawn event, and draw the sort indicator yourself. You would have to check if the column being drawn is in the e.TableControl.TableDescriptor.SortedColumns column. There is no color property for a Control.BorderStyle which is all that is around the grid. One thing you can do is to add a panel to the form where your grid is and set the panel backcilor to the color you want to see the border. Also set the panel.DockPadd = 1 (or how wide you want the border. Then set the grid''s BorderStyle to none, and drop the grid on the panel with grid.Dock = Fill. This should make teh grid have a colored border.


AD Administrator Syncfusion Team October 19, 2004 06:55 AM

Hi Clay, Thanks for the explaination. I can live with bordered column headers (just so the sort indicator can show) and the entire groupinggrid control''s border workaround works great! One more question. I notice that when any cell within the grid gets focus, another border is drawn (in black) around it. Is there any way to eliminate this effect.


AD Administrator Syncfusion Team October 19, 2004 10:20 AM

Try setting: this.gridGroupingControl1.TableModel.Options.ShowCurrentCellBorderBehavior = GridShowCurrentCellBorder.HideAlways;

Loader.
Live Chat Icon For mobile
Up arrow icon