作成日: 2017/05/01 最終更新日: 2017/05/01
文書種別
使用方法
詳細
デフォルトのフィルタ列定義(FilterColumnDefinitionクラス)ではフィルタリングのドロップダウンリストに必要な条件等が自動的に表示されますが、FilterListBehavior 列挙体の値を変更することで、ドロップダウンリストの表示方法を変更できます。
◎サンプルコード(VB)
◎サンプルコード(C#)
◎サンプルコード(VB)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If IsPostBack Then
Return
End If
FpSpread1.ActiveSheetView.RowCount = 5
' テストデータの設定
FpSpread1.ActiveSheetView.Cells(0, 0, 0, 2).Value = "apple"
FpSpread1.ActiveSheetView.Cells(1, 0, 1, 2).Value = "orange"
FpSpread1.ActiveSheetView.Cells(2, 0, 2, 2).Value = "pear"
' 1列目のドロップダウンリスト項目に「空白セル」と「空白以外のセル」を表示しない
Dim fcd1 As New FarPoint.Web.Spread.FilterColumnDefinition(0, FarPoint.Web.Spread.FilterListBehavior.SortAlphabetically)
' 2列目のドロップダウンリスト項目で「空白以外のセル」を表示しない
Dim fcd2 As New FarPoint.Web.Spread.FilterColumnDefinition(1, FarPoint.Web.Spread.FilterListBehavior.SortAlphabetically Or FarPoint.Web.Spread.FilterListBehavior.Blank)
' 3列目のドロップダウンリスト項目に「空白セル」を表示しない
Dim fcd3 As New FarPoint.Web.Spread.FilterColumnDefinition(2, FarPoint.Web.Spread.FilterListBehavior.SortAlphabetically Or FarPoint.Web.Spread.FilterListBehavior.NonBlank)
Dim hf As New FarPoint.Web.Spread.HideRowFilter(FpSpread1.ActiveSheetView)
hf.AddColumn(fcd1)
hf.AddColumn(fcd2)
hf.AddColumn(fcd3)
FpSpread1.ActiveSheetView.RowFilter = hf
End Sub
If IsPostBack Then
Return
End If
FpSpread1.ActiveSheetView.RowCount = 5
' テストデータの設定
FpSpread1.ActiveSheetView.Cells(0, 0, 0, 2).Value = "apple"
FpSpread1.ActiveSheetView.Cells(1, 0, 1, 2).Value = "orange"
FpSpread1.ActiveSheetView.Cells(2, 0, 2, 2).Value = "pear"
' 1列目のドロップダウンリスト項目に「空白セル」と「空白以外のセル」を表示しない
Dim fcd1 As New FarPoint.Web.Spread.FilterColumnDefinition(0, FarPoint.Web.Spread.FilterListBehavior.SortAlphabetically)
' 2列目のドロップダウンリスト項目で「空白以外のセル」を表示しない
Dim fcd2 As New FarPoint.Web.Spread.FilterColumnDefinition(1, FarPoint.Web.Spread.FilterListBehavior.SortAlphabetically Or FarPoint.Web.Spread.FilterListBehavior.Blank)
' 3列目のドロップダウンリスト項目に「空白セル」を表示しない
Dim fcd3 As New FarPoint.Web.Spread.FilterColumnDefinition(2, FarPoint.Web.Spread.FilterListBehavior.SortAlphabetically Or FarPoint.Web.Spread.FilterListBehavior.NonBlank)
Dim hf As New FarPoint.Web.Spread.HideRowFilter(FpSpread1.ActiveSheetView)
hf.AddColumn(fcd1)
hf.AddColumn(fcd2)
hf.AddColumn(fcd3)
FpSpread1.ActiveSheetView.RowFilter = hf
End Sub
◎サンプルコード(C#)
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
return;
}
FpSpread1.ActiveSheetView.RowCount = 5;
// テストデータの設定
FpSpread1.ActiveSheetView.Cells[0, 0, 0, 2].Value = "apple";
FpSpread1.ActiveSheetView.Cells[1, 0, 1, 2].Value = "orange";
FpSpread1.ActiveSheetView.Cells[2, 0, 2, 2].Value = "pear";
// 1列目のドロップダウンリスト項目に「空白セル」と「空白以外のセル」を表示しない
FarPoint.Web.Spread.FilterColumnDefinition fcd1 = new FarPoint.Web.Spread.FilterColumnDefinition(0, FarPoint.Web.Spread.FilterListBehavior.SortAlphabetically);
// 2列目のドロップダウンリスト項目で「空白以外のセル」を表示しない
FarPoint.Web.Spread.FilterColumnDefinition fcd2 = new FarPoint.Web.Spread.FilterColumnDefinition(1, FarPoint.Web.Spread.FilterListBehavior.SortAlphabetically | FarPoint.Web.Spread.FilterListBehavior.Blank);
// 3列目のドロップダウンリスト項目に「空白セル」を表示しない
FarPoint.Web.Spread.FilterColumnDefinition fcd3 = new FarPoint.Web.Spread.FilterColumnDefinition(2, FarPoint.Web.Spread.FilterListBehavior.SortAlphabetically | FarPoint.Web.Spread.FilterListBehavior.NonBlank);
FarPoint.Web.Spread.HideRowFilter hf = new FarPoint.Web.Spread.HideRowFilter(FpSpread1.ActiveSheetView);
hf.AddColumn(fcd1);
hf.AddColumn(fcd2);
hf.AddColumn(fcd3);
FpSpread1.ActiveSheetView.RowFilter = hf;
}
{
if (IsPostBack)
{
return;
}
FpSpread1.ActiveSheetView.RowCount = 5;
// テストデータの設定
FpSpread1.ActiveSheetView.Cells[0, 0, 0, 2].Value = "apple";
FpSpread1.ActiveSheetView.Cells[1, 0, 1, 2].Value = "orange";
FpSpread1.ActiveSheetView.Cells[2, 0, 2, 2].Value = "pear";
// 1列目のドロップダウンリスト項目に「空白セル」と「空白以外のセル」を表示しない
FarPoint.Web.Spread.FilterColumnDefinition fcd1 = new FarPoint.Web.Spread.FilterColumnDefinition(0, FarPoint.Web.Spread.FilterListBehavior.SortAlphabetically);
// 2列目のドロップダウンリスト項目で「空白以外のセル」を表示しない
FarPoint.Web.Spread.FilterColumnDefinition fcd2 = new FarPoint.Web.Spread.FilterColumnDefinition(1, FarPoint.Web.Spread.FilterListBehavior.SortAlphabetically | FarPoint.Web.Spread.FilterListBehavior.Blank);
// 3列目のドロップダウンリスト項目に「空白セル」を表示しない
FarPoint.Web.Spread.FilterColumnDefinition fcd3 = new FarPoint.Web.Spread.FilterColumnDefinition(2, FarPoint.Web.Spread.FilterListBehavior.SortAlphabetically | FarPoint.Web.Spread.FilterListBehavior.NonBlank);
FarPoint.Web.Spread.HideRowFilter hf = new FarPoint.Web.Spread.HideRowFilter(FpSpread1.ActiveSheetView);
hf.AddColumn(fcd1);
hf.AddColumn(fcd2);
hf.AddColumn(fcd3);
FpSpread1.ActiveSheetView.RowFilter = hf;
}
旧文書番号
40333