I have a MainGrid in Wpf (not a DataGrid) it has 3 rows(0.1 and 2) i have made rows using xaml at design time now at run time behind a menu button i want to add 2 column to row 1 of the main grid.
The hard par开发者_如何学Pythont is that only break the row 1 into 2 columnn and not the whole Grid.
i know that to add new rows and columns one can use rowdefination and columndefination but
couldnt find anything here:
MainGrid.RowDefinitions.ElementAt(1).SetValue...;
Thanks
Why don't you add a Grid
with 1 row and 2 columns to that row instead. And put your contents in that Grid
. That will be easier.
make the column span = 2 for all the controls that you add in row 2 and 3...
精彩评论