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

[Solved] Performance issues with large numbers of columns

1 Answer 176 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Noah
Top achievements
Rank 1
Noah asked on 24 Sep 2010, 05:29 PM
I am working on creating a pivot table using the Telerik RadGridView for Silverlight.  The current implementation creates an ObservableCollection of
public class PivotRow
{
    private Dictionary<string, PivotCell> _Cells = new Dictionary<string, PivotCell>();
 
    public Dictionary<string, PivotCell> Cells
    {
        get { return _Cells; }
    }
}
 
The columns are created as such:

PivotDataGrid.ItemsSource = null;
PivotDataGrid.Columns.Clear();
for (var i = 0; i < this.Query.Display.RowAxes.Count; i++)
{
    PivotDataGrid.Columns.Add(
        new GridViewDataColumn()
        {
            DataMemberBinding = new Binding("Cells[PRC" + i + "]"),
            IsReadOnly = true
        });
}
 
if (this.Query.Display.ColumnAxes.Count > 0)
{
    PivotDataGrid.Columns.Add(
            new GridViewDataColumn()
            {
                DataMemberBinding = new Binding("Cells[CPAC]"),
                IsReadOnly = true
            });
}
 
for (var i = 0; i < pivotMatrixColumnCount; i++)
{
    PivotDataGrid.Columns.Add(
        new GridViewDataColumn()
        {
            DataMemberBinding = new Binding("Cells[M" + i + "]"),
            IsReadOnly = true
        });
}

I am currently using default binding (my cell instances override ToString() and return a simple string.  Scrolling performance is fine if the pivot is all rows (permutations of axis/axis value combinations), but when it's all columns (#of rows and columns are interchanged) performance slows to a crawl.  

So I have a few questions.  First, is there a better way to handle this than creating an ObservableCollection<PivotRow> and filling in every cell?  I lazily load some of the underlying data when pivot detail cells are actually fetched, however I'd much rather be able to specify my bounds (which can be huge) and fill in cells as requested.  Second, how do I get performance back when the # of columns is quite large?  

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 30 Sep 2010, 11:35 AM
Hello Noah,

 Unfortunately you cannot do much with the current grid version to improve performance in case of for example 10000 columns. One improvement can be to specify explicit Width for the columns (for example ColumnWidth="150") however even in this case you will get performance problems with large number of columns. 

All the best,
Vlad
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
Noah
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or