---
title: "WPF DataGrid Column Width"  
description: "WPF DataGrid Column Width"  
author: "Anonymous User"  
published: 2013-09-03  
updated: 2013-09-03  
canonical: https://www.mindstick.com/forum/1420/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 in Advance.

## Replies

### Reply by Sumit Kesarwani

Hi Ashish,\

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>
```

Hope this will solve your problem.


---

Original Source: https://www.mindstick.com/forum/1420/wpf-datagrid-column-width

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
