Spread ASP.NET 15
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread Namespace / FilterBar Class / Cells Property
Example


In This Topic
    Cells Property (FilterBar)
    In This Topic
    Gets the FilterBarCellCollection object of the filter bar.
    Syntax
    'Declaration
     
    Public ReadOnly Property Cells As FilterBarCellCollection
    'Usage
     
    Dim instance As FilterBar
    Dim value As FilterBarCellCollection
     
    value = instance.Cells
    public FilterBarCellCollection Cells {get;}
    Example
    This example sets properties for a filter bar cell.
    protected void Page_Load(object sender, System.EventArgs e)
    {
    if (this.IsPostBack) return;
    FpSpread1.Sheets[0].RowCount = 6;
    FpSpread1.Sheets[0].ColumnCount = 6;
    //Customize "Cells" in Filter Bar
    FarPoint.Web.Spread.SheetView sheetView = FpSpread1.ActiveSheetView;
    sheetView.AutoFilterMode = FarPoint.Web.Spread.AutoFilterMode.FilterBar;
    sheetView.FilterBar.Cells[0].Border = new FarPoint.Web.Spread.Border(Color.Red);
    sheetView.FilterBar.Cells[0].BackColor = Color.GreenYellow;
    sheetView.FilterBar.Cells[0].CellType = new FarPoint.Web.Spread.FilterBarCellType();
    sheetView.FilterBar.DefaultStyle.Border = new FarPoint.Web.Spread.Border(Color.Yellow);
    FarPoint.Web.Spread.FilterBarCellType cellType = new FarPoint.Web.Spread.FilterBarCellType();
    cellType.DropDownButton  = false;
    cellType.MenuType = FarPoint.Web.Spread.FilterMenuType.Auto;
    sheetView.FilterBar.Cells[3].CellType = cellType;
    sheetView.FilterBar.Height = 30;
    sheetView.FilterBar.DefaultHeaderStyle.Border = new FarPoint.Web.Spread.Border(Color.Red);
    sheetView.FilterBar.DefaultHeaderStyle.BackColor = Color.Yellow;
    FpSpread1.ActiveSheetView.Cells[0, 0, 2, 5].Text = "Test";
    FpSpread1.ActiveSheetView.Cells[3, 0, 5, 5].Text = "A";
    }
    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).RowCount = 6
    FpSpread1.Sheets(0).ColumnCount = 6
    'Customize "Cells" in Filter Bar
    Dim sheetView As FarPoint.Web.Spread.SheetView = FpSpread1.ActiveSheetView
    sheetView.AutoFilterMode = FarPoint.Web.Spread.AutoFilterMode.FilterBar
    sheetView.FilterBar.Cells(0).Border = New FarPoint.Web.Spread.Border(Drawing.Color.Red)
    sheetView.FilterBar.Cells(0).BackColor = Drawing.Color.GreenYellow
    sheetView.FilterBar.Cells(0).CellType = New FarPoint.Web.Spread.FilterBarCellType()
    sheetView.FilterBar.DefaultStyle.Border = New FarPoint.Web.Spread.Border(Drawing.Color.Yellow)
    Dim cellType As New FarPoint.Web.Spread.FilterBarCellType()
    cellType.DropDownButton = True
    cellType.MenuType = FarPoint.Web.Spread.FilterMenuType.Auto
    sheetView.FilterBar.Cells(3).CellType = cellType
    sheetView.FilterBar.Height = 30
    sheetView.FilterBar.DefaultHeaderStyle.Border = New FarPoint.Web.Spread.Border(Drawing.Color.Red)
    sheetView.FilterBar.DefaultHeaderStyle.BackColor = Drawing.Color.Yellow
    FpSpread1.ActiveSheetView.Cells(0, 0, 2, 5).Text = "Test"
    FpSpread1.ActiveSheetView.Cells(3, 0, 5, 5).Text = "A"
    End Sub
    See Also