We can set a control to fit a Windows or a panel control by settings its HorizontalAlignment, VertivalAlignment, Width, and Height properties to Stretch, Stretch, Auto, and Auto.
The following code snippet scales a DataGrid to fit to Window on parent Window.
- <DataGrid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
- Height="Auto" Width="Auto" Name="McDataGrid" >