PowerTools SPREAD for ASP.NET 8.0J
AutoFilteredColumn イベント

ユーザーがフィルタリングを完了したときに発生します。
構文
'Declaration
 
Public Event AutoFilteredColumn As AutoFilteredColumnEventHandler
public event AutoFilteredColumnEventHandler AutoFilteredColumn
イベント データ

イベント ハンドラが、このイベントに関連するデータを含む、AutoFilteredColumnEventArgs 型の引数を受け取りました。次の AutoFilteredColumnEventArgs プロパティには、このイベントの固有の情報が記載されます。

プロパティ説明
Colフィルタ列を取得または設定します。  
FilterStringフィルタ文字列を取得します。  
SpreadSpreadオブジェクトを取得または設定します。  
解説

クライアント側AutoFilteringColumnイベントは、クライアントがフィルタリング要求をサーバーに送信する前に発生します。フィルタリング要求がキャンセルされなかった場合、クライアントはフィルタリング要求をサーバーに送信します。

サーバー側AutoFilteringColumnイベントは、フィルタリング操作が実行される前に発生します。サーバーでフィルタリングがキャンセルされなかった場合は、フィルタリング操作が実行された後にサーバー側AutoFilteredColumnイベントが発生します。

クライアント側AutoFilteredColumnイベントは、クライアントがサーバーからフィルタリング結果を受け取った後に発生します。

sheetviewのRowFilterプロパティがnullの場合、次のイベントは発生しません。
AutoFilteringColumnイベント(サーバー側)、AutoFilteredColumnイベント(サーバー側)、AutoFilteredColumnイベント(クライアント側)

列がコードによってフィルタリングされる場合(たとえば、FpSpread1.ActiveSheetView.AutoFilterColumn(1,"apple")など)、クライアント側AutoFilteringColumnイベントは発生しません。その他3つのイベントは次の順序で発生します。

AutoFilteringColumn(サーバー側)
AutoFilteredColumn(サーバー側)
AutoFilteredColumn(クライアント側)

次のサンプルコードは、AutoFilteredColumnイベントを使用します。
protected void Page_Load(object sender, EventArgs e)
{
    FarPoint.Web.Spread.NamedStyle instyle = new FarPoint.Web.Spread.NamedStyle();
    FarPoint.Web.Spread.NamedStyle outstyle = new FarPoint.Web.Spread.NamedStyle();
    instyle.BackColor = System.Drawing.Color.Yellow;
    outstyle.BackColor = System.Drawing.Color.Gray;
    FarPoint.Web.Spread.StyleRowFilter rf = new FarPoint.Web.Spread.StyleRowFilter(FpSpread1.Sheets[0], instyle, outstyle);
    FpSpread1.Sheets[0].RowFilter = rf;
    // Assign filter and customize filter options
    FpSpread1.Sheets[0].RowFilter.AddColumn(1);
    FpSpread1.Sheets[0].RowFilter.ShowFilterIndicator = true;
    FpSpread1.Sheets[0].Cells[0, 1].Value = "test";
}

protected void FpSpread1_AutoFilteringColumn(object sender, FarPoint.Web.Spread.FilteringEventArgs e)
{
    FpSpread1.Sheets[0].Cells[0, 0].Text = e.FilterString;
    FpSpread1.Sheets[0].Cells[1, 0].Text = e.Col.ToString();
}
protected void FpSpread1_AutoFilteredColumn(object sender, FarPoint.Web.Spread.FilteredEventArgs e)
{
    FpSpread1.Sheets[0].Cells[0, 0].Text = e.FilterString;
    FpSpread1.Sheets[0].Cells[1, 0].Text = e.Col.ToString();
}
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim instyle As New FarPoint.Web.Spread.NamedStyle()
    Dim outstyle As New FarPoint.Web.Spread.NamedStyle()
    instyle.BackColor = Drawing.Color.Yellow
    outstyle.BackColor = Drawing.Color.Gray
    Dim rf As New FarPoint.Web.Spread.StyleRowFilter(FpSpread1.Sheets(0), instyle, outstyle)
    FpSpread1.Sheets(0).RowFilter = rf
    ' Assign filter and customize filter options
    FpSpread1.Sheets(0).RowFilter.AddColumn(1)
    FpSpread1.Sheets(0).RowFilter.ShowFilterIndicator = True
    FpSpread1.Sheets(0).Cells(0, 1).Value = "test"
End Sub

Protected Sub FpSpread1_AutoFilteringColumn(ByVal sender As Object, ByVal e As FarPoint.Web.Spread.FilteringEventArgs) Handles FpSpread1.AutoFilteringColumn
    FpSpread1.Sheets(0).Cells(0, 0).Text = e.FilterString
    FpSpread1.Sheets(0).Cells(1, 0).Text = e.Col.ToString()
End Sub

Protected Sub FpSpread1_AutoFilteredColumn(ByVal sender As Object, ByVal e As FarPoint.Web.Spread.FilteredEventArgs) Handles FpSpread1.AutoFilteredColumn
    FpSpread1.Sheets(0).Cells(0, 0).Text = e.FilterString
    FpSpread1.Sheets(0).Cells(1, 0).Text = e.Col.ToString()
End Sub
参照

FpSpread クラス
FpSpread メンバ

 

 


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