Scrollbars disappear when window is resized

Jan 6, 2016 at 5:14 PM
I built the ExtendedGrid from source, from the 2010 solution. I changed the target framework to 4.5.2.
When I use the ExtendedGrid and set the Vertical or HorizontalScrollbarVisibility to "Auto", the scrollbars disappear when the window is resized.
In the xaml below, if the GridSplitter is uncommented, moving the Splitter makes the scrollbars visible again.
<Window x:Class="WpfExtendedGrid.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:ExtGrid="clr-namespace:ExtendedGrid.ExtendedGridControl;assembly=ExtendedGrid"
        mc:Ignorable="d" 
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="5" />
            <ColumnDefinition Width="*" MinWidth="28" />
        </Grid.ColumnDefinitions>
        <ExtGrid:ExtendedDataGrid x:Name="dg1" 
            VerticalScrollBarVisibility="Auto"
            HorizontalScrollBarVisibility="Auto"
                                  >
        </ExtGrid:ExtendedDataGrid>
        <!--
        <GridSplitter Width="5" Grid.Column="1" HorizontalAlignment="Stretch" />
        -->
        <ExtGrid:ExtendedDataGrid x:Name="dg2" 
            HorizontalScrollBarVisibility="Auto"
            VerticalScrollBarVisibility="Visible"
                                  Grid.Column="2">
        </ExtGrid:ExtendedDataGrid>
    </Grid>
</Window>
What am I doing wrong?
Thanks for any insight --
Coordinator
Jan 6, 2016 at 5:41 PM
Just to check replace Extended data grid with normal data grid and check if you are getting same behavior.

As extended data grid inherits data grid but it's view is customised.

Kindly let me know if issue is there in datagrid or not, fix would be in extended Data grid style.
I don't have VS which support 4.5.2.

But can assist if can be reproducible in 2010.
Jan 6, 2016 at 7:07 PM
The problem does not occur when I replace the ExtendedDataGrid with the plain DataGrid.

The oldest version of Visual Studio that I have is VS2012 -- would it help to try to build it in that?
Alternatively, I could set the target framework to 4.0 in all the relevant projects and try it.

I just set the target framework to 4.0 for the ExtendedDataGrid and my test project, put a DataGrid in one column and an ExtendedDataGrid in the other column -- when I ran the application, scrollbars set to "Auto" in the ExtendedDataGrid disappeared when I resized the window, and reappeared when the Splitter was moved.
There were no similar issues with the DataGrid.
Mar 24, 2016 at 12:29 AM
Edited Mar 24, 2016 at 12:36 AM
I am also experiencing this issue. Any time the container window is resized, both horizontal and vertical scrollbars disappear. I'm using your grid control in a User Control, which is hosted inside a tab control. Vertical scroll bar setting is explicitly set to "Auto", and I clearly have more rows than can be displayed, even when the window is maximized.

Here are some other characteristics:
  • I don't seem to have this issue when using a plain data grid.
  • Mouse scroll wheel and arrow keys will still scroll the grid.
  • Maximizing or minimizing the window have no effect.
  • On rare occasions (I suspect when scrolling causes an auto-width column to resize wider), the scroll bars will re-appear, but in general I must close the container (I'm using a tab control) and re-open it to get the scroll bars back.
  • I'm currently using Visual Studio 2015, but have the same problem when using VS2012. I very much doubt it's the IDE (as ccbVT suggests) - more likely something in the code.
Any ideas on how to address this? If it's a bug, any chance of getting a fix (or a pointer so I can fix it locally)? Any assistance would be appreciated!