WPF How to put button into row which is inside column

1.8k Views Asked by At

How can I put button into row which is inside column?

   <Grid.ColumnDefinitions>
        <ColumnDefinition Width="200" />
        <ColumnDefinition MinWidth="300" Width="*" />
    </Grid.ColumnDefinitions>
    <Grid Grid.Column="1">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition MaxHeight="50" MinHeight="50"/>
        </Grid.RowDefinitions>
    </Grid>

Grid.Row="2" is out of index. Grid.Colum="1" puts the button into correct column. What might be the correct way to use those rows?

1

There are 1 best solutions below

0
On BEST ANSWER

Your initial row index guess was correct. You just need to put your button in the proper place in your XAML.

<Grid>
  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="200" />
    <ColumnDefinition MinWidth="300" Width="*" />
  </Grid.ColumnDefinitions>
  <Grid Grid.Column="1">
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="*"/>
        <RowDefinition MaxHeight="50" MinHeight="50"/>
    </Grid.RowDefinitions>
    <Button Grid.Row="2"/>
  </Grid>
</Grid>