Is it possible to make visible vertical scrollbar for single row in DataGrid?

769 Views Asked by At

I have a DataGrid with single row. I want to scroll the content inside the DataGrid. I have used following way to do it.

<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" MaxHeight="250">
     <DataGrid  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" MaxWidth="800" Grid.Row="1"/>
 </ScrollViewer>

As I am using ScrollViewer outside the datagrid, it scrolls whole datagrid. I want to scroll content inside row by enabling vertical scrollbar for a single row. Is this possible?

1

There are 1 best solutions below

6
On BEST ANSWER

Delete the ScrollViewer, DataGrid has got its own Scrollviewer builtin. Set

ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"

or

ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Visible"

in your DataGrid