Reader Level:
ARTICLE

Custom Gridline Color of Datagrid in WPF

On June 26, 2010 Articles | WPF
In this article we will see how we can customize the Gridline color in datagrid in WPF.
  • 0
  • 0
  • 17006
Download Files:
 

Introduction

In this article we will see how we can customize the Gridline color in datagrid in WPF.

Creating WPF Application

Fire up Visual Studio 2010 and create a WPF Application, name the solution as CustomDatagrid.

Figure1.gif

Add a Datagrid to the application by dragging from the toolbox to the designer.

Figure2.gif

Here are the initial settings when you add the Datagrid.

Now let's fill in the datagrid with sample data.

Figure3.gif

Now let's see how it looks without the Height customization.

Figure4.gif

In Datagrid we have couple of properties like HorizontalGridLinesBrush and VerticalGridLinesBrush. By default the Brushes are Black.

Figure5.gif
Figure6.gif

 Let's change the above Brushes to Blue and Red respectively.

Now run the application, and you would see the changes.

Figure7.gif

Hope this article helps.
  

Diptimaya Patra

Visit in http://diptimayapatra.wordpress.com for latest articles.Facebook Page: https://www.facebook.com/MethodOfTried

  • 37rank
  • 4M readers
  • 1times
COMMENT USING

Trending up