Creating a table-like user interface
Table layout is a popular placement strategy, supported by the
Grid panel. Let's examine the
Grid and see what it's capable of.
Make sure Visual Studio is up and running.
How to do it...
We'll create a simple UI that benefits from a grid-like layout and demonstrate some of its features:
- Create a new WPF application named
MainWindow.xaml. There's already a
Gridplaced inside the
Window. That's because the
Gridis typically used as the main layout panel within a window.
- Change the
- Inside the
Grid, add the following markup to create some rows and columns:
<Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition ...