Posted 10 September 2017, 10:59 am EST
RemoveRows with formula too slowwwwwwww
Code:
ShowSource = new ObservableCollection
int row = 1500;
for (int i = 0; i < row; i++)
{
ShowSource.Add(new Source { A = i.ToString(), B = i.ToString(), C = i.ToString(), D = “d” + i,E=“E”+i,F=“f”+i,G =“g”+ i, H =“h”+ i, I =“i”+ i, K = “k”+i, J =“j”+ i, L =“l”+ i });
}
ssTest.Sheets[0].DataSource = ShowSource;
ssTest.Sheets[0].Cells["A1:A"+ row + ""].Formula = "(A1+B1)+1"; ssTest.Sheets[0].Cells["B1:B" + row + ""].Formula = "(A1+B1)+1"; ssTest.Sheets[0].Cells["C1:C" + row + ""].Formula = "(A1+B1)+1"; ssTest.Sheets[0].Cells["D1:D" + row + ""].Formula = "(A1+B1)+1"; ssTest.Sheets[0].Cells["E1:E" + row + ""].Formula = "(A1+B1)+1"; ssTest.Sheets[0].Cells["F1:F" + row + ""].Formula = "(A1+B1)+1"; ssTest.Sheets[0].Cells["G1:G" + row + ""].Formula = "(A1+B1)+1"; ssTest.Sheets[0].Cells["H1:H" + row + ""].Formula = "(A1+B1)+1";
When you try to remove one row like:
ssTest.Sheets[0].RemoveRows(0,1,SheetArea.Cells);
Almost need 10 second…
How to improve the performance