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

RadGridView copying large data sets

3 Answers 88 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 16 Jun 2016, 02:12 AM

Hi, I have a RadGridView which is setup to have:

RowVirtualization=True
ColumnVirtualization=True
SelectionMode=Extended
ClipboardCopymode=Cells,Header
AutoGenerateColumns=False

There are 6 columns in this grid all bound to strings similar to
<telerik:GridViewDataColumn Header="FirstName"  DataMemberBinding="{Binding Name}">

I have populated the grid with ~60,000 records

Pressing ctrl+A to select all takes about 3 seconds (which I am ok with I guess)
My problem is pressing Ctrl+C to copy all the rows just freezes the UI and it never finishes (I force closed the app after about 5 minutes if I walk away for about 20 it finishes eventually)

Why does copying all these rows take so long? Is there a way I can speed it up?
I made sure I populated the grid completely first so all this time taken is purely the copy method?

 

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 20 Jun 2016, 01:35 PM
Hi Brad,

I am sorry that you are experiencing such performance issue with the copying functionality.

Unfortunately, with the demonstrated project setup such behavior is not reproducible on my end, so I can only be guessing what the cause for it might be. Can you please share some more details on your project setup, so we can try reproducing such performance degradation of the copying of RadGridView? Generally, any information provided might be useful.

Best Regards,
Stefan X1
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Brad
Top achievements
Rank 1
answered on 21 Jun 2016, 04:56 AM

Hi StephanX1,

 

So I have done some investigation of my own and I have found that adding

void grid_CopyingCellClipboardContent(object sender, GridViewCellClipboardEventArgs e)
{

     if(e != null && e.Value == null)
         e.Value = string.Empty;
}

Drastically reduces the amount of time copying takes so I am guessing it does not like null values for some reason

Even so ~60,000 records takes 30-60 seconds is that about the best performance I can expect?

Some of the properties being used are doing small mathematically calculations i.e.

public decimal TotalValue

{

   get

   {

   return this.items * this.price;

   }

}

Some are also enumeration lookups

public enum Status
{
Unknown = 0,
Rejected = 'R',
Approved = 'A',
}

If that matters at all for the most part they are plain strings being copied

0
Stefan
Telerik team
answered on 22 Jun 2016, 10:19 AM
Hello Brad,

I made a research on the reported scenario and I was not able to find any difference in the performance of the copying mechanism with null values. Based on this I assume that the performance hit is not directly related to the copying of RadGridView. I am glad that you've found a workaround for the issue you are experiencing, however, I can only be guessing what the cause for it might be, as it is not reproducible on my end.

Best Regards,
Stefan X1
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
GridView
Asked by
Brad
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Brad
Top achievements
Rank 1
Share this question
or