DataGrid V1: ScrollBar issue

Nov 19, 2008 at 6:51 PM
Hi,
After re-initializing the datagrid programmatically the ScrollBar disappears when not using grouping. Using grouping the ScrollBar appears again.
The ScrollBars visibility is set to Visible already.

While re-initializing I'm clean up columns, items, sorting, grouping.

Does anyone has an idea what to do?

Many thanks in advance.
WorstCase.
Coordinator
Nov 19, 2008 at 11:06 PM
Which scrollbar are we talking about Vertical or Horizontal?

Can you post a simple repro XAML and code??
Nov 20, 2008 at 9:43 AM
Hi,
It is the vertical scrollbar.
I find out that the groupStyle should not be set at the beginning when not using any groupDescription after initializing the datagrid.

After using grouping and clean up the groups again by deleting the groupstyles then the vertical scrollbar disappears.
When using this method the vertical scrollbar disappears.
private
void ClearGrouping ( )
{
dg.GroupStyle.Clear ();
ICollectionView view = CollectionViewSource.GetDefaultView (dg.ItemsSource);
if (view != null)
{
view.GroupDescriptions.Clear ();
}
}


When using this method the vertical scrollbar still exists.
private void ClearGrouping ( )
{
        //    dg.GroupStyle.Clear ();
ICollectionView view = CollectionViewSource.GetDefaultView (dg.ItemsSource);
if (view != null)
{
view.GroupDescriptions.Clear ();
}
}


Thank you.