i want to have the grid layout dynamic. pretty much the only modification needed is that i need sometimes more and less rows and columns. So the thing is, how do i access the row- & columndefinition in my c# class?
<StackPanel Grid.Row="1" VerticalAlignment="Stretch">
<Grid Name="mygrid" Height="490">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
</Grid>
</StackPanel>
Though with c# i am not getting to any solution. I tried with this attempt, though came to no conclusion
mygrid.ColumnDefinitions
Can somebody point me into the right direction?