Spread for ASP.NET 11 Product Documentation
ColorFilterItem Constructor
Example 


FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > ColorFilterItem Class : ColorFilterItem Constructor
A boolean value that specifies the filter based on the forecolor
A color value that specifies the color
Creates a new ColorFilter instance with a customized setting.
Syntax
'Declaration
 
Public Function New( _
   ByVal filterTextColor As Boolean, _
   ByVal color As Color _
)
'Usage
 
Dim filterTextColor As Boolean
Dim color As Color
 
Dim instance As New ColorFilterItem(filterTextColor, color)
public ColorFilterItem( 
   bool filterTextColor,
   Color color
)

Parameters

filterTextColor
A boolean value that specifies the filter based on the forecolor
color
A color value that specifies the color
Example
This example creates a color filter.
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
See Also

Reference

ColorFilterItem Class
ColorFilterItem Members