I have a layout problem with a datagrid in my C# WPF application. If the content of my datagrid can’t be displayed in my datagrid because there are to many rows, a scrollviewer (and scrollbar) is displayed. This is the correct way and I’m happy about it.
The problem is, that the position of the scrollviewer in my datagrid ist wrong. The scrollviewer starts in the header row, but the Scrollbar is displayed in the first row of my content. In the header there is a white retangle. This is because the background of my datagrid is white. But the background of my header is gray.
I uploaded a picture with a red arrow to clarify my problem. The white retangle looks really ugly, so in my opinion it’s the better way to change the position of the scrollviewer, so it starts in the first row of the content. Maybe there is another possibility to solve the problem?
“Datagrid with Scrollviewer”-Image:

Thanks for any hints, which will help me to solve the problem!
Best regards,
Flasher
you can make your own style for your datagrid, here is a style made with blend with two changes
look at these two changes
for
PART_VerticalScrollBar->Grid.Row="0"andGrid.RowSpan="2"and for the grid that holds the
PART_HorizontalScrollBar->Grid.ColumnSpan="2"here is the complete style
hope this helps