Grid in ScrollViewer : Grid « Windows Presentation Foundation « C# / CSharp Tutorial






<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  HorizontalAlignment="Center" VerticalAlignment="Center">
<ScrollViewer>
  <Grid>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="*" />
      <ColumnDefinition Width="Auto" />
      <ColumnDefinition Width="Auto" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <Border Grid.Column="0" Grid.Row="0" Background="LightGray" BorderBrush="Gray" BorderThickness="1">
      <TextBlock>Key</TextBlock>
    </Border>
    <Border Grid.Column="1" Grid.Row="0" Background="LightGray" BorderBrush="Gray" BorderThickness="1">
        <TextBlock>Value</TextBlock>
    </Border>
    <Border Grid.Column="2" Grid.Row="0" Background="LightGray" BorderBrush="Gray" BorderThickness="1">
      <TextBlock>Value 2</TextBlock>
    </Border>
    <TextBlock Grid.Column="0" Grid.Row="1" Text="WPF" />
    <TextBlock Grid.Column="1" Grid.Row="1" Text="Inc." />
    <TextBlock Grid.Column="2" Grid.Row="1" Text="this" />
    <TextBlock Grid.Column="0" Grid.Row="2" Text="is" />
    <TextBlock Grid.Column="1" Grid.Row="2" Text="a" />
    <TextBlock Grid.Column="2" Grid.Row="2" Text="test" />
  </Grid>
</ScrollViewer>
</Page>
WPF Grid In Scroll Viewer








24.42.Grid
24.42.1.Simple Grid.xamlSimple Grid.xaml
24.42.2.Use Grid to layout a CalendarUse Grid to layout a Calendar
24.42.3.Grid with Rectangle and GeometryDrawingGrid with Rectangle and GeometryDrawing
24.42.4.Set Grid Row and Column for a ButtonSet Grid Row and Column for a Button
24.42.5.Arrange UI Elements in a GridArrange UI Elements in a Grid
24.42.6.Align Ellipses along with GridAlign Ellipses along with Grid
24.42.7.Show Grid LinesShow Grid Lines
24.42.8.Multiple Items in a Grid CellMultiple Items in a Grid Cell
24.42.9.Grid in ScrollViewerGrid in ScrollViewer
24.42.10.Margin vs Padding and GridMargin vs Padding and Grid
24.42.11.Window with GridWindow with Grid
24.42.12.Arrange the children for GridArrange the children for Grid
24.42.13.Put more than one Object to one Grid CellPut more than one Object to one Grid Cell
24.42.14.Nested GridNested Grid
24.42.15.Shared Size GroupShared Size Group
24.42.16.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.
24.42.17.Place and size rectangles and ellipses in Grid cellsPlace and size rectangles and ellipses in Grid cells
24.42.18.Use Image as the Grid backgroundUse Image as the Grid background
24.42.19.Grid with SharedSizeGroupGrid with SharedSizeGroup
24.42.20.Layout a Form with StackPanel and GridLayout a Form with StackPanel and Grid
24.42.21.Layout Controls with Grid in codeLayout Controls with Grid in code