This is a migrated thread and some comments may be shown as answers.

Binding Performance

1 Answer 49 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 30 May 2011, 10:07 PM
I'm creating a RadGridView programatically (see code below) and bind it to an ObservableCollection. I find the binding performance quite troublesome. When the Documents property the grid is bound to changes it takes approx 1.5sec before the grid is done. The documents collection never contains more than 200 items.

var List = new RadGridView
{
Name = "List",
RowIndicatorVisibility = Visibility.Collapsed,
IsReadOnly = true,
AutoGenerateColumns = false,
CanUserFreezeColumns = false,
CanUserResizeColumns = false,
IsFilteringAllowed = false,
ShowGroupPanel = false,
EnableRowVirtualization = true,
EnableColumnVirtualization = true,
SelectionMode = SelectionMode.Single,
Background = (Brush)Application.Current.Resources["DocumentList_Background"],
BorderBrush = (Brush)Application.Current.Resources["DocumentList_Border"],
Margin = new Thickness(9, 4, 8, 4)
};

listControl = List;

// bind items source to viewmodel
List.SetBinding(DataControl.ItemsSourceProperty, new Binding(ReflectionUtil.GetPropertyName(() => VM.Documents)));

List.Columns.Add(new GridViewDataColumn
{
Header = Strings.DocumentList_SummaryColumn_Header,
DataMemberBinding = new Binding("Summary"),
Width = new GridViewLength(1, GridViewLengthUnitType.Star),
ToolTipTemplate = (DataTemplate)Application.Current.Resources["DetailsListSummaryColumnToolTipTemplate"],
});

List.Columns.Add(new GridViewDataColumn
{
Header = Strings.DocumentList_UpdatedColumn_Header,
SortMemberPath = "LastUpdate",
Width = GridViewLength.Auto,
CellTemplate = (DataTemplate)Application.Current.Resources["DateLastUpdateColumnCellTemplate"],
ToolTipTemplate = (DataTemplate)Application.Current.Resources["DetailsListDateUpdatedColumnToolTipTemplate"],
});

// sync selected item with currently selected document
List.DataLoaded += (sender, e) =>
{
var MWVM = ServiceLocator.Get<MainWindowViewModel>();

List.SelectionChanged -= OnGridViewSelectionChanged;

if (MWVM.SelectedDocument != null)
{
List.ScrollIntoView(MWVM.SelectedDocument);
List.SelectedItem = MWVM.SelectedDocument;
}

List.SelectionChanged += OnGridViewSelectionChanged;
};

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 31 May 2011, 08:47 AM
Hi Oliver,

Currently there are no know issues with performance. Could you please provide a sample application where the performance problem is evident?


Regards,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Oliver
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or