Mega Code Archive

 
Categories / C# / WPF
 

Grid in ScrollViewer

<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>