Roberto Salemi

Roberto Salemi

  • NA
  • 146
  • 142.1k

[WPF] How show vertical scrollbar in DataGrid 'fullwidth'

May 5 2015 7:04 AM
Hi,
I have this code:
<Grid VerticalAlignment="Top">
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Toolbar Command -->
<StackPanel Orientation="Horizontal" Margin="0,0,0,0" Visibility="Visible" Grid.Row="0">
[MY CONTENT]
</StackPanel>

<StackPanel Grid.Row="1">
<DataGrid Name="dgSample" --MY PROPERTY--
ScrollViewer.CanContentScroll="True" 
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto">
<DataGrid.Columns>
...
</DataGrid.Columns>
</DataGrid>
</StackPanel>
</Grid>

In Grid:
- first row has height 50
- second row has full height for to view data in fullwith mode
As I have set the height datagrid as I can see the vertical scrollbar into DataGrid?
Thanks.

Answers (2)