SIGN UP MEMBER LOGIN:    
ARTICLE

Custom Row and Header Height of Datagrid in WPF

Posted by Diptimaya Patra Articles | WPF with C# June 25, 2010
In this article we will see how we can customize the row height and header height in datagrid in WPF.
Reader Level:
Download Files:
 

Introduction

In this article we will see how we can customize the row height and header height in datagrid in WPF.

Creating WPF Application

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

image1.gif

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

image2.gif

Here are the initial settings when you add the Datagrid.

image3.gif

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

image4.gif

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

image5.gif

Now, in the datagrid properties. Change the ColumnHeaderHeight to your required height in this case let's take 30.

image6.gif

As well as the RowHeight to 24.

image6.1.gif


Now run the application to see the changes.

image7.gif

That's it.

Hope this article helps.
 

erver'>
Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
    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. Visit DynamicPDF here
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor