I am facing an issue. In my view I have a DataGrid whose Horizontal Scroll Bar’s Visibility is set to Auto. Problem I am facing is that the scroll bar is appearing all the time even if there is enough space for DataGrid to expand and completely display itself. I have tried almost everything but couldn’t figure out whats is wrong.
I have uploaded a sample application to demonstrate the problem here. Hoping anyone will point out mistake I am making.
I did following changes/workarounds to solve the issue. It might not be the perfect solution but works for me.
I added two more columns in the
Grid, one in the start and one at the end.Then I increased the
ColumnSpanofDataGrid...Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="6" ....Then I added this line in
ConstrcutorofWindowspecialCol.Width = new GridLength (2);and changed
UpdateGridmethod to thisI don’t see any
HorizontalScrollBarnow until it is required