Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
Slow with a large amount of data
posted

Good morning.
I am using Infragistics Excel to treat a large amount of data that I bind to a XamGrid. The problem is that the loading of the grid takesover 15 seconds, while the data bind without using Infragistics Excel loads in less than a second. There are 35 000 rows and 50columns in my dataset.Here is how the data loading is done and the binding.

Do you know a way to speed up treatment?

Worksheet sheetOne =dataWorkbook.Worksheets.Add("Stock");

WorksheetRow worksheetRow = sheetOne.Rows[0]; 

for (int rowId = 0; rowId < e.Result.Count(); rowId++)

{

 

 

 

 

 

worksheetRow = sheetOne.Rows[rowId + 1];

 

worksheetRow.Cells[0].Value = e.Result[rowId].reference;

worksheetRow.Cells[1].Value = e.Result[rowId].abr_srayon;

...

...

worksheetRow.Cells[50].Value = e.Result[rowId].MB2;

 }

<ig:XamGrid.Columns> 

<ig:XamGrid x:Name="dataGrid" AutoGenerateColumns="False" Grid.Column="3" Margin="0,0,-852,0" >

 

 

 

 

<ig:TextColumn Key="Cells[0].Value"/> 

<ig:TextColumn Key="Cells[1].Value"/> 

<ig:TextColumn Key="Cells[2].Value"/>

...

 

 

 

 

<ig:TextColumn Key="Cells[50].Value"/>  

 

Parents
No Data
Reply
  • 44743
    Suggested Answer
    posted

    If you are not already using version 11.1, I would strongly recommend upgrading to that version. There were many memory and performance enhancements made in that version. Then I would suggest using the WorksheetRow.SetCellValue method instead of getting the cell through the indexer and setting the Value property. SetCellValue is much faster and does not need to create a WorksheetCell instance, which makes a big difference when you are set the values of 1,750,000 cells. Also, I see that in your code, you are getting e.Result[rowId] 50 times (once for each cell). I would cache that in a local variable when you cache the row, so you don't need to index into e.Result 50 times at the same index.

Children
No Data