コード例 #1
0
ファイル: ExcelAutoFilter.cs プロジェクト: yosmanyhs/EPPlus-1
 /// <summary>
 /// Applies the filter, hiding rows not matching the filter columns
 /// </summary>
 public void ApplyFilter()
 {
     foreach (var column in Columns)
     {
         column.SetFilterValue(_worksheet, Address);
     }
     for (int row = Address._fromRow + 1; row <= _address._toRow; row++)
     {
         var rowInternal = ExcelRow.GetRowInternal(_worksheet, row);
         rowInternal.Hidden = false;
         foreach (var column in Columns)
         {
             var value = _worksheet.GetCoreValueInner(row, Address._fromCol + column.Position);
             var text  = ValueToTextHandler.GetFormattedText(value._value, _worksheet.Workbook, value._styleId, false);
             if (column.Match(value._value, text) == false)
             {
                 rowInternal.Hidden = true;
                 break;
             }
         }
     }
 }