MESCIUS SPREAD for Windows Forms 17.0J サンプルコード集
Excelライクフィルタを有効にする

AutoFilterModeプロパティにEnhancedContextMenuを設定し、指定したCoumnクラスのAllowAutoFilterプロパティをTrueにすると、Excelライクフィルタが有効になります。

【実行例】実行前

Excelライクフィルタ:実行前

【実行例】フィルタの表示

Excelライクフィルタ:フィルタの表示

private void Form1_Load(object sender, EventArgs e)
{
  // 自動フィルタリングを有効
  fpSpread1.ActiveSheet.Columns[3].AllowAutoFilter = true;
  // Excelライクフィルタを有効
  fpSpread1.ActiveSheet.AutoFilterMode = FarPoint.Win.Spread.AutoFilterMode.EnhancedContextMenu;

  fpSpread1.ActiveSheet.Cells[0, 3].Value = "North";
  fpSpread1.ActiveSheet.Cells[1, 3].Value = "South";
  fpSpread1.ActiveSheet.Cells[2, 3].Value = "East";
  fpSpread1.ActiveSheet.Cells[3, 3].Value = "South";
  fpSpread1.ActiveSheet.Cells[4, 3].Value = "North";
  fpSpread1.ActiveSheet.Cells[5, 3].Value = "North";
  fpSpread1.ActiveSheet.Cells[6, 3].Value = "West";
  fpSpread1.ActiveSheet.Columns[3].Width = 80;
}
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  ' 自動フィルタリングを有効
  FpSpread1.ActiveSheet.Columns(3).AllowAutoFilter = True
  ' Excelライクフィルタを有効
  FpSpread1.ActiveSheet.AutoFilterMode = FarPoint.Win.Spread.AutoFilterMode.EnhancedContextMenu

  FpSpread1.ActiveSheet.Cells(0, 3).Value = "North"
  FpSpread1.ActiveSheet.Cells(1, 3).Value = "South"
  FpSpread1.ActiveSheet.Cells(2, 3).Value = "East"
  FpSpread1.ActiveSheet.Cells(3, 3).Value = "South"
  FpSpread1.ActiveSheet.Cells(4, 3).Value = "North"
  FpSpread1.ActiveSheet.Cells(5, 3).Value = "North"
  FpSpread1.ActiveSheet.Cells(6, 3).Value = "West"
  FpSpread1.ActiveSheet.Columns(3).Width = 80
End Sub

 

 


© MESCIUS inc. All rights reserved.