PowerTools SPREAD for ASP.NET 8.0J
ColorFilterItem コンストラクタ

前景色に基づくフィルタを指定するブール値
色を指定するカラー値
カスタマイズした設定を使用して、新しいColorFilterインスタンスを作成します。
構文
'Declaration
 
Public Function New( _
   ByVal filterTextColor As Boolean, _
   ByVal color As Color _
)
public ColorFilterItem( 
   bool filterTextColor,
   Color color
)

パラメータ

filterTextColor
前景色に基づくフィルタを指定するブール値
color
色を指定するカラー値
次のサンプルコードは、色フィルタを作成します。
protected void Page_Load(object sender, System.EventArgs e)
{
    if (this.IsPostBack) return;
    FpSpread1.Sheets[0].Cells[1,0,1,2].BackColor = Color.Red;
    FpSpread1.Sheets[0].Cells[0,0,0,2].BackColor = Color.Aqua;
    FpSpread1.Sheets[0].Cells[2, 0, 2, 2].BackColor = Color.Blue;
    FarPoint.Web.Spread.ColorFilterItem colorfilter = new FarPoint.Web.Spread.ColorFilterItem(false, Color.Red);    
    FarPoint.Web.Spread.IRowFilter rowFilter = new FarPoint.Web.Spread.HideRowFilter(FpSpread1.ActiveSheetView);    
    FarPoint.Web.Spread.FilterColumnDefinition fd = new FarPoint.Web.Spread.FilterColumnDefinition(1, FarPoint.Web.Spread.FilterListBehavior.Custom);
    fd.Filters.Add(colorfilter);
    rowFilter.ColumnDefinitions.Add(fd);
    FpSpread1.ActiveSheetView.RowFilter = rowFilter;
    FpSpread1.ActiveSheetView.AutoFilterColumn(1, colorfilter.DisplayName);
    FpSpread1.ActiveSheetView.AutoFilterMode = FarPoint.Web.Spread.AutoFilterMode.Enhanced;
}
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    If IsPostBack Then
        Return
    End If
    FpSpread1.Sheets(0).Cells(1, 0, 1, 2).BackColor = Drawing.Color.Red
    FpSpread1.Sheets(0).Cells(0, 0, 0, 2).BackColor = Drawing.Color.Aqua
    FpSpread1.Sheets(0).Cells(2, 0, 2, 2).BackColor = Drawing.Color.Blue
    Dim colorfilter As New FarPoint.Web.Spread.ColorFilterItem(False, Drawing.Color.Red)
    Dim rowFilter As New FarPoint.Web.Spread.HideRowFilter(FpSpread1.ActiveSheetView)
    Dim fd As New FarPoint.Web.Spread.FilterColumnDefinition(1, FarPoint.Web.Spread.FilterListBehavior.Custom)
    fd.Filters.Add(colorfilter)
    rowFilter.ColumnDefinitions.Add(fd)
    FpSpread1.ActiveSheetView.RowFilter = rowFilter
    FpSpread1.ActiveSheetView.AutoFilterColumn(1, colorfilter.DisplayName)
    FpSpread1.ActiveSheetView.AutoFilterMode = FarPoint.Web.Spread.AutoFilterMode.Enhanced
End Sub
参照

ColorFilterItem クラス
ColorFilterItem メンバ

 

 


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