---
title: "WPF DataGrid Column Width"  
description: "WPF DataGrid Column Width"  
author: "Jayden Bell"  
published: 2013-09-21  
updated: 2018-05-21  
canonical: https://www.mindstick.com/forum/1473/wpf-datagrid-column-width  
category: "wpf"  
tags: ["wpf"]  
reading_time: 1 minute  

---

# WPF DataGrid Column Width

I have a DataGrid in [WPF](https://www.mindstick.com/forum/304/wpf) with 3 columns. I would like these columns to take up all the [space](https://www.mindstick.com/articles/12954/do-your-electrical-repair-in-your-own-space) available in the [grid](https://www.mindstick.com/forum/369/how-can-i-add-a-column-name-to-my-grid). So for example:

[Column](https://www.mindstick.com/forum/33860/how-to-calculate-column-summary-in-sql-server) 1 takes 40% of the grid's width Column 2 takes 30% of the grid's width Column 3 takes 30% of the grid's width

Such that even when resizing the [window](https://www.mindstick.com/forum/161285/how-does-the-window-console-object-work-in-javascript) or grid the columns width resizes accordingly. Anyway I can achieve this.

Thanks

## Replies

### Reply by Ella Scott

Post is removed by the Admin.

### Reply by Sumit Kesarwani

Hi Jayden,\

I see you already found the answer you were looking for based on your comment. However, in case anybody else runs across this question trying to figure out how to get the column ratios (like your example of Column 1 = 40%, Column 2 = 30%, Column 3 = 30%), you can specify the ratios with * sizing for column widths as follows:

```
<Grid>   
<Grid.ColumnDefinitions>       
<ColumnDefinition Width="4*" />       
<ColumnDefinition Width="3*" />       
<ColumnDefinition Width="3*" />   
</Grid.ColumnDefinitions></Grid>
```


---

Original Source: https://www.mindstick.com/forum/1473/wpf-datagrid-column-width

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
