In my application i need to design the seat layout arrangement in the form of rows and columns dynamically. Please any one suggest me how to get rows and columns and which view i need to use.
this my xaml code
<Grid x:Name="grid" Background="White">
<Button HorizontalAlignment="Stretch" Foreground="Black" Margin="23,56,268,527">Text</Button>
</Grid>
this is .cs code
for (int j = 0; j < jarray.Count; j++)
{
grid.ColumnDefinitions.Add(new ColumnDefinition(){width=new GridLength(30)});
grid.RowDefinitions.Add(new RowDefinition(){ Height = new GridLength(30) });
}
but Iam getting empty page. Thank you in advance.
Updating suggestion here:
you can use Grid Layout. Create a Grid in XAML and define Rowdefinition and ColumnDefinition dynamically in code behind and append to grid. If your xaml has Grid with name "grid" then in code behind you can rows and column like this. You can use loop for more number of rows and cols.
grid.ColumnDefinitions.Add(new ColumnDefinition());
grid.RowDefinitions.Add(new RowDefinition());
Below are few links for ref: