FarPoint.Win.Spread.SortInfo[] sorts = new FarPoint.Win.Spread.SortInfo[this.fpSpread.ActiveSheet.ColumnCount];
for (int i = 0; i < this.fpSpread.ActiveSheet.Columns.Count; i++)
{
if (item.Key == this.fpSpread.ActiveSheet.Columns.Label)
{
if (item.Value == OrderByType.Desc)
{
this.fpSpread.ActiveSheet.Columns.SortIndicator = FarPoint.Win.Spread.Model.SortIndicator.Descending;
sorts = new FarPoint.Win.Spread.SortInfo(i, false);
}
else
{
this.fpSpread.ActiveSheet.Columns.SortIndicator = FarPoint.Win.Spread.Model.SortIndicator.Ascending;
sorts = new FarPoint.Win.Spread.SortInfo(i, true);
}
break;
}
}
this.fpSpread.ActiveSheet.SortRange(0, 0, this.fpSpread.ActiveSheet.RowCount, this.fpSpread.ActiveSheet.ColumnCount, true, sorts); |