Simple Grid.xaml : Grid « Windows Presentation Foundation « C# / C Sharp






Simple Grid.xaml

Simple Grid.xaml
       
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid.RowDefinitions>
        <RowDefinition Height="100" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="100*" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="33*" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="67*" />
    </Grid.ColumnDefinitions>

    <Button Content="Button No. 1" Grid.Row="0" Grid.Column="0" />
    <Button Content="Button No. 2" Grid.Row="1" Grid.Column="0" />
    <Button Content="Button No. 3" Grid.Row="2" Grid.Column="0" />

    <GridSplitter HorizontalAlignment="Center" Width="6"
                  Grid.Row="0" Grid.Column="1" Grid.RowSpan="3" />

    <Button Content="Button No. 4" Grid.Row="0" Grid.Column="2" />
    <Button Content="Button No. 5" Grid.Row="1" Grid.Column="2" />
    <Button Content="Button No. 6" Grid.Row="2" Grid.Column="2" />
 
</Grid>

   
    
    
    
    
    
    
  








Related examples in the same category

1.GridSplitter ExampleGridSplitter Example
2.GridSplitter as Entire Column or RowGridSplitter as Entire Column or Row
3.ColumnDefinition.Width=AutoColumnDefinition.Width=Auto
4.ColumnDefinition.Width=*ColumnDefinition.Width=*
5.Grid With SplitterGrid With Splitter
6.Bind to Grid Width and HeightBind to Grid Width and Height
7.Use Grid to layout a CalendarUse Grid to layout a Calendar
8.Grid with Rectangle and GeometryDrawingGrid with Rectangle and GeometryDrawing
9.Set Grid Row and Column for a ButtonSet Grid Row and Column for a Button
10.Arrange UI Elements in a GridArrange UI Elements in a Grid
11.Grid with Column Definition and Row definitionGrid with Column Definition and Row definition
12.Align Ellipses along with GridAlign Ellipses along with Grid
13.Use GridSplitterUse GridSplitter
14.Define rows / columns for GridDefine rows / columns for Grid
15.Using Grid.ColumnSpanUsing Grid.ColumnSpan
16.Set Grid Row Height and Column Width to AutoSet Grid Row Height and Column Width to Auto
17.Mixing row height stylesMixing row height styles
18.Show Grid LinesShow Grid Lines
19.Multiple Items in a Grid CellMultiple Items in a Grid Cell
20.Grid in ScrollViewerGrid in ScrollViewer
21.Margin vs Padding and GridMargin vs Padding and Grid
22.Without Panel.ZIndexWithout Panel.ZIndex
23.Panel.ZIndexPanel.ZIndex
24.Stretched GridSplitterStretched GridSplitter
25.Window with GridWindow with Grid
26.Arrange the children for GridArrange the children for Grid
27.Set Row Height and column Width for GridSet Row Height and column Width for Grid
28.Set Row and Column Index when Adding Buttons to GridSet Row and Column Index when Adding Buttons to Grid
29.Put more than one Object to one Grid CellPut more than one Object to one Grid Cell
30.Set Column and Row index when adding Controls to a GridSet Column and Row index when adding Controls to a Grid
31.Nested GridNested Grid
32.Shared Size GroupShared Size Group
33.Empty RowDefinition and ColumnDefinitionEmpty RowDefinition and ColumnDefinition
34.Grid Splitter and AlignmentGrid Splitter and Alignment
35.Use the Grid element to create a standard user interface (UI) dialog box.Use the Grid element to create a standard user interface (UI) dialog box.
36.Place and size rectangles and ellipses in Grid cellsPlace and size rectangles and ellipses in Grid cells
37.Use Image as the Grid backgroundUse Image as the Grid background
38.Automatic Width and HeightAutomatic Width and Height
39.Grid with SharedSizeGroupGrid with SharedSizeGroup
40.Layout a Form with StackPanel and GridLayout a Form with StackPanel and Grid
41.Clear All ColumnsClear All Columns
42.Clear All RowsClear All Rows
43.Remove One ColumnRemove One Column
44.Remove One RowRemove One Row
45.The current number of ColumnsThe current number of Columns
46.The current number of RowsThe current number of Rows
47.Remove 5 Columns with ColumnDefinitions.RemoveRangeRemove 5 Columns with ColumnDefinitions.RemoveRange
48.Remove 5 Row with RowDefinitions.RemoveRangeRemove 5 Row with RowDefinitions.RemoveRange
49.Contains RowContains Row
50.Contains Column?Contains Column?
51.Insert RowInsert Row
52.Insert ColumnInsert Column
53.Is Grid ReadOnlyIs Grid ReadOnly
54.Grid mouse down eventGrid mouse down event
55.Grid Preview mouse down eventGrid Preview mouse down event
56.Setting Grid row heights in codeSetting Grid row heights in code
57.Layout Controls with Grid in codeLayout Controls with Grid in code
58.Set control to specific row and column in codeSet control to specific row and column in code
59.Show Grid lines in codeShow Grid lines in code
60.Programmatically use the positioning methods of GridProgrammatically use the positioning methods of Grid
61.Add a ColumnDefinition to GridAdd a ColumnDefinition to Grid
62.Add a RowDefinition to GridAdd a RowDefinition to Grid
63.Grid PreviewMouseDown action and MouseDown actionGrid PreviewMouseDown action and MouseDown action
64.Grid MouseLeftButtonDown action and PreviewMouseLeftButtonDown actionGrid MouseLeftButtonDown action and PreviewMouseLeftButtonDown action