MESCIUS SPREAD for Windows Forms 17.0J
ColumnHeaderAutoFilterIndex プロパティ

複数の列ヘッダ行があるときに、フィルタインジケータを表示するシートの列ヘッダ行を取得または設定します。
構文
'Declaration
 
Public Property ColumnHeaderAutoFilterIndex As Integer
public int ColumnHeaderAutoFilterIndex {get; set;}

プロパティ値

列ヘッダ内の行のインデックスを表す Integer
解説
このプロパティは、ColumnHeader.AutoFilterIndexプロパティと同等です。
次のサンプルコードは、フィルタアイコンを表示する列ヘッダ内の行を指定します。
fpSpread1.ActiveSheet.ColumnHeaderRowCount = 3;
fpSpread1.ActiveSheet.ColumnHeaderAutoFilterIndex = 1;

FarPoint.Win.Spread.DefaultFilter df = new FarPoint.Win.Spread.DefaultFilter(fpSpread1.ActiveSheet);
df.ShowFilterInDropDown(1, new int[] {1, 2, 3, 4, 5, 6, 7, 8});

FarPoint.Win.Spread.NamedStyle instyle = new FarPoint.Win.Spread.NamedStyle();
FarPoint.Win.Spread.NamedStyle outstyle = new FarPoint.Win.Spread.NamedStyle();
instyle.BackColor = Color.Yellow;
outstyle.BackColor = Color.Aquamarine;

FarPoint.Win.Spread.FilterColumnDefinition fcd = new FarPoint.Win.Spread.FilterColumnDefinition(1);
FarPoint.Win.Spread.FilterColumnDefinition fcd1 = new FarPoint.Win.Spread.FilterColumnDefinition(2);
FarPoint.Win.Spread.FilterColumnDefinition fcd2 = new FarPoint.Win.Spread.FilterColumnDefinition(3);

FarPoint.Win.Spread.CustomFilterItem cfi = new FarPoint.Win.Spread.CustomFilterItem("Contains an 'A'", df);
fcd.CustomFilters.Add(cfi);

FarPoint.Win.Spread.StyleRowFilter srf = new FarPoint.Win.Spread.StyleRowFilter(fpSpread1.ActiveSheet, instyle, outstyle);
srf.AddColumn(fcd);
srf.AddColumn(fcd1);
srf.AddColumn(fcd2);

fpSpread1.ActiveSheet.RowFilter = srf;
FpSpread1.ActiveSheet.ColumnHeaderRowCount = 3
FpSpread1.ActiveSheet.ColumnHeaderAutoFilterIndex = 1

Dim df As New FarPoint.Win.Spread.DefaultFilter(FpSpread1.ActiveSheet)
df.ShowFilterInDropDown(1, New Integer() {1, 2, 3, 4, 5, 6, 7, 8})

Dim instyle As New FarPoint.Win.Spread.NamedStyle
Dim outstyle As New FarPoint.Win.Spread.NamedStyle
instyle.BackColor = Color.Yellow
outstyle.BackColor = Color.Aquamarine

Dim fcd As New FarPoint.Win.Spread.FilterColumnDefinition(1)
Dim fcd1 As New FarPoint.Win.Spread.FilterColumnDefinition(2)
Dim fcd2 As New FarPoint.Win.Spread.FilterColumnDefinition(3)

Dim cfi As New FarPoint.Win.Spread.CustomFilterItem("Contains an 'A'", df)
fcd.CustomFilters.Add(cfi)

Dim srf As New FarPoint.Win.Spread.StyleRowFilter(FpSpread1.ActiveSheet, instyle, outstyle)
srf.AddColumn(fcd)
srf.AddColumn(fcd1)
srf.AddColumn(fcd2)

FpSpread1.ActiveSheet.RowFilter = srf
参照

SheetView クラス
SheetView メンバ

開発者ガイド

フィルタリング

 

 


© MESCIUS inc. All rights reserved.