I have a window with a button and a Grid in this window with rows and columns setup. I'm trying to create a button that when clicked will add another row to the Grid and then assign a user control to that row.
I've found a bunch of ways to do this online to datagrids but nothing for adding a rowdefinition to a grid. Can anyone assist with the code for this?
WPF so far:
<DockPanel>
<Button DockPanel.Dock="Top" Height="22" x:Name="AddRow" Click="AddRow_Click">
<TextBlock Text="Add Skill"/>
</Button>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="1"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1"/>
</Grid.RowDefinitions>
</Grid>
</DockPanel>