Hello guys I'm experiencing slow load performance with this simple code:
Xaml:using
System.Linq;
using
System.Windows;
using
System.Windows.Data;
using
System.Collections.ObjectModel;
using
Telerik.Windows.Controls;
using
Telerik.Windows.Controls.GridView;
namespace
SilverlightApplication1
{
public
partial
class
MainPage
{
public
MainPage()
{
InitializeComponent();
gv.AutoGenerateColumns =
false
;
gv.EnableRowVirtualization =
true
;
gv.Columns.Add(
new
GridViewDataColumn2(
"ID"
));
gv.Columns.Add(
new
GridViewDataColumn2(
"Name"
));
DataContext =
new
ObservableCollection<MyObject>(from i
in
Enumerable.Range(0, 1000) select
new
MyObject { Id = i, Name =
string
.Format(
"Name{0}"
, i) });
}
}
public
class
GridViewDataColumn2 : GridViewDataColumn
{
private
readonly
string
_propertyName;
public
GridViewDataColumn2(
string
propertyName)
{
_propertyName = propertyName;
}
public
override
FrameworkElement CreateCellElement(GridViewCell cell,
object
dataItem)
{
var auc =
new
RadMaskedTextInput();
auc.SetBinding(RadMaskedTextInput.ValueProperty,
new
Binding(_propertyName));
return
auc;
}
}
public
class
MyObject
{
public
int
Id {
get
;
set
; }
public
string
Name {
get
;
set
; }
}
}
<UserControl x:Class=
"SilverlightApplication1.MainPage"
xmlns:Controls=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
mc:Ignorable=
"d"
d:DesignHeight=
"300"
d:DesignWidth=
"400"
>
<ScrollViewer x:Name=
"LayoutRoot"
Background=
"White"
>
<Controls:RadGridView x:Name=
"gv"
ItemsSource=
"{Binding}"
/>
</ScrollViewer>
</UserControl>
The problem is on Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureChild(class System.Windows.UIElement,valuetype System.Windows.Size,int32) Telerik.Windows.Controls.GridView.dll because it is causing an unwanted MeasureOverride.