您可调用Spread的IOptimizedSheetAxisModelSupport接口的GetVisibleCount()方法得到可见的总行数和总列数,然后得到不可见的总行数和总列数。例子代码如下:
int visibleRowCount = 0;
int visibleColumnCount = 0;
int hiddenRowCount = 0;
int hiddenColumnCount = 0;
int totalRowCount = this.fpSpread1.ActiveSheet.RowCount;
int totalColumnCount = this.fpSpread1.ActiveSheet.ColumnCount;
FarPoint.Win.Spread.Model.IOptimizedSheetAxisModelSupport rowAxis = this.fpSpread1.ActiveSheet.Models.RowAxis as FarPoint.Win.Spread.Model.IOptimizedSheetAxisModelSupport;
FarPoint.Win.Spread.Model.IOptimizedSheetAxisModelSupport columnAxis = this.fpSpread1.ActiveSheet.Models.ColumnAxis as FarPoint.Win.Spread.Model.IOptimizedSheetAxisModelSupport;
if (rowAxis != null)
{
visibleRowCount = rowAxis.GetVisibleCount(totalRowCount);
hiddenRowCount = totalRowCount - visibleRowCount;
}
if (columnAxis != null)
{
visibleColumnCount = columnAxis.GetVisibleCount(totalRowCount);
hiddenColumnCount = totalRowCount - visibleColumnCount;
} |