PowerTools SPREAD for Windows Forms 8.0J
Add メソッド (FilterItemCollection)


追加するカスタムフィルタ項目
コレクションにフィルタ項目を追加します。
構文
'Declaration
 
Public Function Add( _
   ByVal filterItem As IFilterItem _
) As Integer
'使用法
 
Dim instance As FilterItemCollection
Dim filterItem As IFilterItem
Dim value As Integer
 
value = instance.Add(filterItem)
public int Add( 
   IFilterItem filterItem
)

パラメータ

filterItem
追加するカスタムフィルタ項目

戻り値の型

コレクション内のカスタム フィルタの項目数を表す Integer
例外
例外説明
System.ArgumentException指定されたフィルタの表示名がないか、表示名の長さがゼロです。
System.ArgumentExceptionカスタムフィルタが指定されていないか、指定されたカスタムフィルタがNullです。
次のサンプルコードは、フィルタリングに使用するフィルタを返します。
FarPoint.Win.Spread.NamedStyle instyle = new FarPoint.Win.Spread.NamedStyle(); 
FarPoint.Win.Spread.NamedStyleim 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.FilterListBehavior.SortByMostOccurrences
| FarPoint.Win.Spread.FilterListBehavior.Default); 
FarPoint.Win.Spread.FilterColumnDefinition fcd1 = new FarPoint.Win.Spread.FilterColumnDefinition(2); 
FarPoint.Win.Spread.FilterColumnDefinition fcd2 = new FarPoint.Win.Spread.FilterColumnDefinition(); 
FarPoint.Win.Spread.StyleRowFilter sf = new FarPoint.Win.Spread.StyleRowFilter(fpSpread1.ActiveSheet, instyle, outstyle);

sf.AddColumn(fcd); 
sf.AddColumn(fcd1); 
sf.AddColumn(fcd2);  
fpSpread1.ActiveSheet.RowFilter = sf; 
FarPoint.Win.Spread.FilterItemCollection fc; 
fc = fcd.Filters; 

foreach(FarPoint.Win.Spread.DefaultFilterItem df in fc)
{
     fc.Add(df);
}
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, FarPoint.Win.Spread.FilterListBehavior.SortByMostOccurrences
Or FarPoint.Win.Spread.FilterListBehavior.Default)
Dim fcd1 As New FarPoint.Win.Spread.FilterColumnDefinition(2)
Dim fcd2 As New FarPoint.Win.Spread.FilterColumnDefinition

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

Dim fc As FarPoint.Win.Spread.FilterItemCollection
fc = fcd.Filters
Dim df As FarPoint.Win.Spread.DefaultFilterItem
For Each df In fc
      fc.Add(df)
Next
参照

FilterItemCollection クラス
FilterItemCollection メンバ

 

 


© 2004-2015, GrapeCity inc. All rights reserved.