MESCIUS SPREAD for ASP.NET 10.0J
AutoFilterIndex プロパティ (Column)

列の自動フィルタインデックスを取得または設定します。
構文
'Declaration
 
Public Property AutoFilterIndex As Integer
public int AutoFilterIndex {get; set;}
次のサンプルコードは、AutoFilterIndexプロパティを使用します。
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
参照

Column クラス
Column メンバ

 

 


© MESCIUS inc. All rights reserved.