小表格中可以排序,百万行的大表。我尝试了两种办法,都没有取得成功
方法1:
Aspose.Cells.GridDesktop.Worksheet sheet = gridDesktop1.GetActiveWorksheet();
int izdh = sheet.RowsCount;
int izdl = sheet.ColumnsCount;
int idqh = sheet.GetFocusedCell().Column;
int[] intArray = new int[1];
intArray[0] = idqh;
string ssjbmc = sheet.Name;
Aspose.Cells.GridDesktop.SortOrder[] lsorsz=new Aspose.Cells.GridDesktop.SortOrder[1];
lsorsz[0] = Aspose.Cells.GridDesktop.SortOrder.Ascending;
sheet.Cells.Sort(1, 0, izdh - 1, izdl, intArray, lsorsz,SortOrientation.SortTopToBottom,false);
gridDesktop1.Invalidate();
方法2:
Aspose.Cells.GridDesktop.Worksheet sheet = gridDesktop1.GetActiveWorksheet();
int izdh = sheet.RowsCount;
int izdl = sheet.ColumnsCount;
int idqh = sheet.GetFocusedCell().Column;
int[] intArray = new int[1];
intArray[0] = idqh;
string ssjbmc = sheet.Name;
Aspose.Cells.GridDesktop.SortOrder[] lsorsz = new Aspose.Cells.GridDesktop.SortOrder[1];
lsorsz[0] = Aspose.Cells.GridDesktop.SortOrder.Ascending;
SortRange sr = new SortRange(sheet,1,
0, izdh - 1, izdl,
SortOrientation.SortTopToBottom, false);
sr.Sort(intArray, lsorsz);
gridDesktop1.Invalidate();