Okay so I'm pretty new to WPF and I'm having trouble sizing my DataGrid.
I would like my DataGrid to automatically take up as much space as it needs so that users don't have to scroll through the it. The width should be the total width of all the columns and the height the height of all the rows plus the size of the headers.
I tried this so far:
<DataGrid x:Name="_grid" ItemsSource="{Binding}"
AutoGenerateColumns="True"
AlternatingRowBackground="Cyan"
Height="Auto"
Width="Auto"
/>
This doens't seem to work the DataGrid just takes up all the space in the Grid its placed in overlapping other elements.
I would appreciate any help you guys could give on how I can do this.