Spread for ASP.NET 8.0 Product Documentation
AutoFilterIndex Property (Column)
Example 


Gets or sets the automatic filter index for the column.
Syntax
'Declaration
 
Public Property AutoFilterIndex As Integer
'Usage
 
Dim instance As Column
Dim value As Integer
 
instance.AutoFilterIndex = value
 
value = instance.AutoFilterIndex
public int AutoFilterIndex {get; set;}
Example
This example uses the AutoFilterIndex property.
protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
            FpSpread1.ActiveSheetView.ColumnHeader.RowCount = 3;
            FpSpread1.ActiveSheetView.ColumnHeader.Columns[1].AutoFilterIndex = 1;
            FpSpread1.ActiveSheetView.ColumnHeader.Columns[0].AutoFilterIndex = 2;
            Random rnd = new Random();
            for (int row = 0; row < FpSpread1.ActiveSheetView.RowCount; row++)
            {
                for (int col = 0; col < FpSpread1.ActiveSheetView.ColumnCount; col++)
                {
                    FpSpread1.ActiveSheetView.Cells[row, col].Text = rnd.Next(100).ToString();
                }
            }
            FarPoint.Web.Spread.FilterColumnDefinition fcd0 = new FarPoint.Web.Spread.FilterColumnDefinition(0,
              FarPoint.Web.Spread.FilterListBehavior.SortByMostOccurrences | FarPoint.Web.Spread.FilterListBehavior.Default);
            FarPoint.Web.Spread.FilterColumnDefinition fcd1 = new FarPoint.Web.Spread.FilterColumnDefinition(1,
              FarPoint.Web.Spread.FilterListBehavior.SortByMostOccurrences | FarPoint.Web.Spread.FilterListBehavior.Default);
            FarPoint.Web.Spread.HideRowFilter hf = new FarPoint.Web.Spread.HideRowFilter(FpSpread1.ActiveSheetView);
            hf.AddColumn(fcd0);
            hf.AddColumn(fcd1);
            FpSpread1.ActiveSheetView.RowFilter = hf;
        }
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (IsPostBack) Then
            Return
        End If        
        FpSpread1.ActiveSheetView.ColumnHeader.RowCount = 3
        FpSpread1.ActiveSheetView.ColumnHeader.Columns(1).AutoFilterIndex = 1
        FpSpread1.ActiveSheetView.ColumnHeader.Columns(0).AutoFilterIndex = 2
        Dim rnd As New Random()
        For row As Integer = 0 To FpSpread1.ActiveSheetView.RowCount - 1
            For col As Integer = 0 To FpSpread1.ActiveSheetView.ColumnCount - 1
                FpSpread1.ActiveSheetView.Cells(row, col).Text = rnd.[Next](100).ToString()
            Next
        Next
        Dim fcd0 As New FarPoint.Web.Spread.FilterColumnDefinition(0, FarPoint.Web.Spread.FilterListBehavior.SortByMostOccurrences Or FarPoint.Web.Spread.FilterListBehavior.[Default])
        Dim fcd1 As New FarPoint.Web.Spread.FilterColumnDefinition(1, FarPoint.Web.Spread.FilterListBehavior.SortByMostOccurrences Or FarPoint.Web.Spread.FilterListBehavior.[Default])
        Dim hf As New FarPoint.Web.Spread.HideRowFilter(FpSpread1.ActiveSheetView)
        hf.AddColumn(fcd0)
        hf.AddColumn(fcd1)
        FpSpread1.ActiveSheetView.RowFilter = hf
End Sub
Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

Column Class
Column Members

 

 


Copyright © GrapeCity, inc. All rights reserved.