I've run into an issue where GridView will freeze when trying to auto-adjust column widths to the available window if a group is applied. I have a series of columns, most of which are Width="Auto", but one of which is Width="*". If I resize the window to allow the * column to expand, then try to reduce the width while a grouping is applied, the horizontal scroll bar flashes and the application freezes. Sometimes it comes back, sometimes it doesn't. Sometimes switching to another window and back seems to help, sometimes it doesn't.
Pausing the debugger while this is occurring (which is only possible some of the time; sometimes Visual Studio is frozen as well) tries to open the file:
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\ScrollViewer\GridViewScrollViewer.cs
The call stack is:
[External Code]
Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewScrollViewer.MeasureOverride(System.Windows.Size availableSize) Line 202 + 0x25 bytes C#
[External Code]
The problem does not occur if the * column is switched to Auto, or if the Grouping is not applied. It also doesn't seem to happen if no vertical scrolling is necessary.
I am using 2013_3_1209, but have verified the problem still occurs with 2014_1_0224. Below is a simple application which exhibits the problem when you try to reduce the width of the window.
Is there any known way to work around this issue using other settings while achieving the same effect?
Pausing the debugger while this is occurring (which is only possible some of the time; sometimes Visual Studio is frozen as well) tries to open the file:
c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\ScrollViewer\GridViewScrollViewer.cs
The call stack is:
[External Code]
Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewScrollViewer.MeasureOverride(System.Windows.Size availableSize) Line 202 + 0x25 bytes C#
[External Code]
The problem does not occur if the * column is switched to Auto, or if the Grouping is not applied. It also doesn't seem to happen if no vertical scrolling is necessary.
I am using 2013_3_1209, but have verified the problem still occurs with 2014_1_0224. Below is a simple application which exhibits the problem when you try to reduce the width of the window.
Is there any known way to work around this issue using other settings while achieving the same effect?
<
Window
x:Class
=
"Scroll.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"500"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
telerik:RadGridView
ItemsSource
=
"{Binding Path=Items}"
AutoGenerateColumns
=
"False"
AutoExpandGroups
=
"True"
VerticalAlignment
=
"Stretch"
HorizontalAlignment
=
"Stretch"
>
<
telerik:RadGridView.GroupDescriptors
>
<
telerik:GroupDescriptor
Member
=
"Group"
/>
</
telerik:RadGridView.GroupDescriptors
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"Name"
DataMemberBinding
=
"{Binding Path=Name}"
Width
=
"Auto"
/>
<
telerik:GridViewDataColumn
Header
=
"Number"
DataMemberBinding
=
"{Binding Path=Number}"
Width
=
"*"
/>
<
telerik:GridViewDataColumn
Header
=
"Group"
DataMemberBinding
=
"{Binding Path=Group}"
Width
=
"Auto"
/>
<
telerik:GridViewDataColumn
Header
=
"Text"
DataMemberBinding
=
"{Binding Path=Text}"
Width
=
"Auto"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
Grid
>
</
Window
>
using
System.Collections.ObjectModel;
using
System.Windows;
namespace
Scroll
{
public
class
Item
{
public
string
Name {
get
;
set
; }
public
int
Number {
get
;
set
; }
public
string
Group {
get
;
set
; }
public
string
Text {
get
;
set
; }
}
public
partial
class
MainWindow : Window
{
public
ObservableCollection<Item> Items {
get
;
set
; }
public
MainWindow()
{
InitializeComponent();
Items =
new
ObservableCollection<Item>();
for
(
int
i = 0; i < 25; i++)
Items.Add(
new
Item()
{
Name =
"Object "
+ i,
Number = i,
Group = (i % 2 == 1 ?
"Odd"
:
"Even"
),
Text =
"this is just some long text to make the window have to resize some things."
});
DataContext =
this
;
}
}
}