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

Performance Problem with Data Exporting

1 Answer 56 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nagisa
Top achievements
Rank 1
Nagisa asked on 23 Mar 2012, 10:16 AM
I have a performance problem with Data Exporting.
I export the data in gridview like following source,
GridViewExportOptions exportOptions = new GridViewExportOptions();
exportOptions.Format = format;
exportOptions.ShowColumnFooters = false;
exportOptions.ShowColumnHeaders = true;
exportOptions.ShowGroupFooters = false;
exportOptions.Encoding = System.Text.Encoding.Unicode;
exportOptions.Items = ((QueryableCollectionView)gridView.ItemsSource).SourceCollection;
 
gridView.Export(stream, exportOptions);

or  output to clipboard like following source,

System.Windows.Clipboard.SetText(gridView.ToText(((QueryableCollectionView)gridView.ItemsSource).SourceCollection, true, false));

It takes over  30s to output data about 20,000 with PC that spec is Inter i7, memory is 8GB,
and takes over 1min to output the same data with PC that spec is Inter dual core 2 1GHz, memory is 1GB.

The time of processing is too long to me,
there is any way to prompt the performance of outputting data ? 

Best regards

1 Answer, 1 is accepted

Sort by
0
Nagisa
Top achievements
Rank 1
answered on 23 Mar 2012, 05:51 PM
By the way , I want to active busy indicator while exporting data.
But I noted that I can't display busy indicator even though set BusyIndicator.IsBusy by true.
I think the process of displaying busy indicator will be done after the command of exporting.

My source likes following,

public class ExportToFile : ICommand
{
...
 
public void Execute(object parameter)
{

      // active busy indicator
    RaiseOnPreparingForCommand();
 
    RadGridView gridView = parameter as RadGridView;
  
 
    // initial context for exporting such as create exportOptions and getting stream to be wrote.
    ...
    gridView.Export( stream, exprotOptions);
    
          // disable busy indicator
    RaiseOnExportingCompleted();
}
  
}
 
// delegate method set into PreparingForCommand event (executed when RaiseOnPreparingForCommand() is called)
(s, e) =>
{
    // I set the BusyIndicator into App.RootVisual when initializing App, and Page will be content of BusyIndicator.
    (BusyIndicator((App)App.Current).RootVisual).IsBusy = true;
}
 
// delegate method set into ExportingCompleted event (executed when RaiseOnExportingCompleted() is called)
(s, e)=>
{
    (BusyIndicator((App)App.Current).RootVisual).IsBusy = false;
}

How can I display busy indicator while exporting data?

Best regards.
Tags
GridView
Asked by
Nagisa
Top achievements
Rank 1
Answers by
Nagisa
Top achievements
Rank 1
Share this question
or