How do you hide the gridlines separating the cells

How do you hide the gridlines separating the cells form each other.

I've tried the following without any effect:

                oGridGroupingControl.TableModel.Properties.GridLineColor = Color.Empty;
                //The following code illustrates how to display vertical lines in GridGrouping control: 
                oGridGroupingControl.DisplayVerticalLines = false;
                //The following code illustrates how to display horizontal lines in GridGrouping control: 
                oGridGroupingControl.DisplayHorizontalLines = false;
                oGridGroupingControl.GridLineColor = Color.Empty;
                oGridGroupingControl.DefaultGridBorderStyle = GridBorderStyle.None;

If I remember correct another potential solution was to edit the cell at the Cell_query event, but that seems huge overhead for a simple table wide setting.

3 Replies

AR Arulpriya Ramalingam Syncfusion Team November 29, 2017 10:46 AM UTC

Hi James,   
   
Thanks for contacting Syncfusion support.   
   
We have tried all the possibilities to reproduce the issue and the reported issue will be occurred when use the DisplayVerticalLines and DisplayHorizontalLines properties after setting Metro theme. So, we suspect that, you are using Metro theme in your application. Please use any one of the below suggestions to resolve the reported scenario.   
  
Suggestion 1   
   
The Borders of Metro theme will be drawn based on DisplayVerticalLines and DisplayHorizontalLines property which is true while initializing. So, if you are using Metro theme, we request you to set the DisplayVerticalLines and DisplayHorizontalLines property as false before setting the Metro theme. Please refer to the below code,   
   
Code example    
   
//Hide the grid lines befor setting metro theme   
gridGroupingControl1.DisplayVerticalLines = false;   
gridGroupingControl1.DisplayHorizontalLines = false;   
   
//Set the Metro theme for the grid   
this.gridGroupingControl1.ThemesEnabled = true;   
this.gridGroupingControl1.GridVisualStyles = GridVisualStyles.Metro;   
   
Suggestion 2   
   
You can also use the Borders property of GridStyleInfo to set the border style as none. We have created a simple sample as per your requirement. Please make use of below code and sample,   
   
Code example   
   
//Set the Metro theme for the grid   
this.gridGroupingControl1.ThemesEnabled = true;   
this.gridGroupingControl1.GridVisualStyles = GridVisualStyles.Metro;   
   
//To set the disable/hide the borders   
this.gridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.Borders.All =new GridBorder(GridBorderStyle.None);   
   
   
Please let us know if you have any other queries.   
   
Regards,   
Arulpriya 



JR James Roodt November 29, 2017 10:56 AM UTC

You are correct. I am using the Metro theme.

Your solution 2 was perfect and solved my issue. Thank you very much.


AR Arulpriya Ramalingam Syncfusion Team November 30, 2017 09:21 AM UTC

Hi James, 
 
Thanks for your update.    
 
We are glad to hear that the provided solution was resolved your scenario.   
 
Please let us know if you have any other queries.    
   
Regards, 
Arulpriya 


Loader.
Up arrow icon