---
title: "WPF Datagrid Autoresize on Maximize"  
description: "WPF Datagrid Autoresize on Maximize"  
author: "Royce Roy"  
published: 2013-09-21  
updated: 2013-09-23  
canonical: https://www.mindstick.com/forum/1475/wpf-datagrid-autoresize-on-maximize  
category: "wpf"  
tags: ["wpf"]  
reading_time: 1 minute  

---

# WPF Datagrid Autoresize on Maximize

My [WPF](https://www.mindstick.com/forum/304/wpf) [application](https://www.mindstick.com/articles/12824/calculator-application-in-android) has a [resolution](https://www.mindstick.com/articles/12502/looking-for-an-mba-degree-we-guide-you-with-the-perfect-resolution) of 1024x768. I have a datagrid that fills a [vertical](https://www.mindstick.com/forum/12951/how-to-fix-bootstrap-tab-vertical-with-text) half of the application. In higher resolutions, when I maximize I want the datagrid to automatically resize vertically and fill the entire height. How can I do this?

## Replies

### Reply by Sumit Kesarwani

Hi Royce,\
You can try setting the control's vertical alignment to stretch (VeritcalAlignment="Stretch") so that even when your window resizes, it still fills up the vertical part of your screen.


---

Original Source: https://www.mindstick.com/forum/1475/wpf-datagrid-autoresize-on-maximize

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
