The HorizontalScrollBar is disabled when there is no data in DataGrid.

Mar 31, 2009 at 1:12 PM
The HorizontalScrollBar is disabled when there is no data in DataGrid.
To view the columns out of window, we must drag the Horizontal Scroll Bar.
How to solve this problem?

<Window x:Class="WpfApplication12.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300" xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit">
    <Grid>
        <my:DataGrid Margin="10,36,26,60" Name="dataGrid1" AutoGenerateColumns="False" HorizontalScrollBarVisibility="Visible">
            <my:DataGrid.Columns>
                <my:DataGridTextColumn Header="DataGridTextColumn" />
                <my:DataGridTextColumn Header="DataGridTextColumn" />
                <my:DataGridTextColumn Header="DataGridTextColumn" />
                <my:DataGridTextColumn Header="DataGridTextColumn" />
            </my:DataGrid.Columns>
        </my:DataGrid>
    </Grid>
</Window>
Coordinator
Mar 31, 2009 at 8:28 PM
Hi Jetsun,

Can you tell us more about the scenario you are trying to enable to help us determine if there is a work-around?  In the meantime we are tracking this bug and will investigate the root cause.

Alexis
Apr 1, 2009 at 2:52 AM
In our application, there are a lot of columns in the DataGrid.
Because of the limitation of the size of window, some left-side columns are invisible.
User need to drag the horizontal scroll bar the make the hidden columns visible.

As one special scenario, we also test the case that there is no data in DataGrid.
We found the Horizontal Scroll Bar is disabled,
then user cannot view the headers of the hidden columns  by dragging the scroll bar.
Feb 12, 2010 at 2:32 PM

Did you find a solution or workaround for this issue?