DataGrid horizontal scrollbar issue

Feb 1, 2009 at 2:40 PM
Edited Feb 1, 2009 at 2:49 PM
Hello all!

I found strange datagrid behavior. I have following XAML:


Window x:Class="WpfApplication1.Window1" xmlns= xmlns:x=

xmlns:tk= Title="Window1" Height="300" Width="300">


<XmlDataProvider x:Key="prov" XPath="/Items/Item">


<Items xmlns="">









<Name>LED Indicator</Name>












<Name>Network Adapter</Name>









<tk:DataGrid ItemsSource="{Binding Source={StaticResource prov}}" AutoGenerateColumns="False">


<tk:DataGridTextColumn Width="50" MinWidth="50" Header="#" Binding="{Binding XPath=Number}"/>

<tk:DataGridTextColumn Width="*" Header="Name" Binding="{Binding XPath=Name}"/>

<tk:DataGridTextColumn Width="70" Header="Count" Binding="{Binding XPath=Count}"/>

<tk:DataGridTextColumn Width="70" Header="Price" Binding="{Binding XPath=Price}" CanUserSort="False"/>






And when I set minimum width of the window like this:

horizontal scrollbar is shown. It's ok, but when I expand my window, horizontal scroll bar is "flashing" and when I stop, horizontal scrollbar is never hide. Window look like:

Is it a bug? How can I avoid that behavior?

Thanks in advance!


Feb 2, 2009 at 8:36 AM

I try to update to Jan 2009 release and this issue is repeated

Feb 5, 2009 at 5:57 AM

Can anyone post a comment - is it a bug and what can I do to avoid this behavior?
Feb 9, 2009 at 7:25 PM

The behavior in the first pic is not a bug. This happens when size of viewport becomes less than the sum of MinWidths of the columns.

However the behavior in the second pic is a bug. I am not sure about the dates but next update should have this fix. And there is no easy way to work it around.
Feb 11, 2009 at 6:34 AM
Ok, thank you for your reply
Apr 6, 2009 at 4:32 PM
Edited Apr 6, 2009 at 4:35 PM
It seems that the bug is still alive.
The scrollbars are always shown, while using ScrollBarVisibility hidden or disabled.

     GridLinesVisibility="Vertical" VerticalGridLinesBrush="LightGray"
     HorizontalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
     VerticalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"

Is there an existing workaround, or a date for a next release wich will surely resolve the bug ?

Apr 6, 2009 at 5:47 PM
After reviewing my code and externalizing it in a blank project, the issue seems coming from my theme, and not from the framework.

Is it possible to know from what Type is the container for the rows ? (above the header, containing the whole rows)

Another question for design this time :
How to redefine the background of the columns header container ? (wich contains the ColumnHeaderStyle restyled part)