--- title: "How to: Share Sizing Properties Between Grids" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "Grid control [WPF], sharing sizing data of columns" - "sizing data in Grid controls [WPF]" - "Grid control [WPF], sharing sizing data of rows" ms.assetid: a0535a6f-ff04-4b25-9912-7dd856e11044 --- # How to: Share Sizing Properties Between Grids This example shows how to share the sizing data of columns and rows between elements in order to keep sizing consistent. ## Example The following example introduces two elements as child elements of a parent . The attached property of is defined on the parent . The example manipulates the property value by using two elements; each element represents one of the Boolean property values. When the property value is set to `true`, each column or row member of a shares sizing information, regardless of the content of a row or column. [!code-xaml[gridIssharedsizescopeProp#1](~/samples/snippets/csharp/VS_Snippets_Wpf/gridIssharedsizescopeProp/CSharp/Window1.xaml#1)] ... [!code-xaml[gridIssharedsizescopeProp#2](~/samples/snippets/csharp/VS_Snippets_Wpf/gridIssharedsizescopeProp/CSharp/Window1.xaml#2)] The following code-behind example handles the methods that the button event raises. The example writes the results of these method calls to elements that use related get methods to output the new property values as strings. [!code-csharp[gridIssharedsizescopeProp#3](~/samples/snippets/csharp/VS_Snippets_Wpf/gridIssharedsizescopeProp/CSharp/Window1.xaml.cs#3)] [!code-vb[gridIssharedsizescopeProp#3](~/samples/snippets/visualbasic/VS_Snippets_Wpf/gridIssharedsizescopeProp/VisualBasic/Window1.xaml.vb#3)] ## See also - - - [Panels Overview](panels-overview.md)