--- title: "How to: Resize Columns with a GridSplitter" ms.date: "03/30/2017" helpviewer_keywords: - "grid columns [WPF], resizing" - "GridSplitter control [WPF], resizing grid columns" - "resizing grid columns [WPF]" ms.assetid: 47b20fe6-7adc-4aa6-9693-b4e184eef74b --- # How to: Resize Columns with a GridSplitter This example shows how to create a vertical in order to redistribute the space between two columns in a without changing the dimensions of the . ## Example **How to create a GridSplitter that overlays the edge of a column** To specify a that resizes adjacent columns in a , set the attached property to one of the columns that you want to resize. If your has more than one row, set the attached property to the number of rows. Then set the property to or (which alignment you set depends on which two columns you want to resize). Finally, set the property to . [!code-xaml[GridSplitterRowColumn#GridSplitterColumnOverlay](~/samples/snippets/csharp/VS_Snippets_Wpf/GridSplitterRowColumn/CS/Window1.xaml#gridsplittercolumnoverlay)] A that does not have its own column may be obscured by other controls in the . For more information about how to prevent this issue, see [Make Sure That a GridSplitter Is Visible](how-to-make-sure-that-a-gridsplitter-is-visible.md). **How to create a GridSplitter that occupies a column** To specify a that occupies a column in a , set the attached property to one of the columns that you want to resize. If your Grid has more than one row, set the attached property to the number of rows. Then set the to , set the property to , and set the of the column that contains the to . The following example shows how to define a vertical that occupies a column and resizes the columns on either side of it. [!code-xaml[GridSplitterRowColumn#GridSplitterEntireColumnPart1](~/samples/snippets/csharp/VS_Snippets_Wpf/GridSplitterRowColumn/CS/Window1.xaml#gridsplitterentirecolumnpart1)] [!code-xaml[GridSplitterRowColumn#GridSplitterEntireColumnPart2](~/samples/snippets/csharp/VS_Snippets_Wpf/GridSplitterRowColumn/CS/Window1.xaml#gridsplitterentirecolumnpart2)] ## See also - - [How-to Topics](gridsplitter-how-to-topics.md)