Articles in this section
Category / Section

How to remove gridlines from GridControl

1 min read

WPF GridControl provides support to remove the gridlines by setting the Borders of the cell using either QueryCellInfo event or TableStyle property of GridModel class.

Please find the code example for your reference,

C#

 
// For entire table          
grid.Model.TableStyle.Borders.All = new Pen(Brushes.Transparent, 0);
 
//For particular range
grid.Model[4, 4].Borders.All = new Pen(Brushes.Transparent, 0);

//For Header cells
grid.Model.HeaderStyle.Borders.All = new Pen(Brushes.Transparent, 0);
 

Users can also achieve the above requirements by invoking QueryCellInfo Event of GridControl,

C#

grid.Model.QueryCellInfo += Model_QueryCellInfo;
 
private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
    //For Header cells 
 
    if (e.Cell.RowIndex == 0 && e.Cell.ColumnIndex == 0)
        e.Style.Borders.All = new Pen(Brushes.Transparent, 0);
 
    //For particular range
 
    if (e.Cell.RowIndex == 3)
        e.Style.Borders.All = new Pen(Brushes.Transparent, 0);
 
    // For entire table 
        
    e.Style.Borders.All = new Pen(Brushes.Transparent, 0);
}
 

 


Conclusion

I hope you enjoyed learning about how to remove gridlines from GridControl.

You can refer to our WPF Grid featuretour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF Grid demo to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied