This will do what you want:
<Grid> <Grid.RowDefinitions> <RowDefinition Height="1*"/> <RowDefinition Height="1*"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="70"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <DataGrid Name="dgMain" AutoGenerateColumns="True"></DataGrid> </Grid>
together with that:
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Foo foo; List<Foo> foos = new List<Foo>(); foo = new Foo() { Name = "Sjaak" }; foos.Add(foo); foo = new Foo() { Name = "Joepie" }; foos.Add(foo); dgMain.ItemsSource = foos; } } public class Foo { public Foo() { } public String Name { get; set; } }
The focus is in the proportional (even) distribution of row heights, using "1 *" for the Height properties of both rows. You can also assign it to other "common" ones by setting one line "Height" to "2 *", etc.
source share