SIGN UP MEMBER LOGIN:    
ARTICLE

Custom Gridline Color of Datagrid in WPF

Posted by Diptimaya Patra Articles | WPF with C# June 26, 2010
In this article we will see how we can customize the Gridline color in datagrid in WPF.
Reader Level:
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.
  

Login to add your contents and source code to this article
share this article :
post comment
 

- It have saved very much my time. Thank very much

Posted by NguyenThanhDat Jun 27, 2011

this is a simple app

Posted by Jacky Lee Jan 07, 2011

Thank you for the post...



Madhu

Posted by Madhusudhan reddy Jun 30, 2010
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor