Spread ASP.NET 6.0 Product Documentation
AutoFilteringColumn Event
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > FpSpread Class : AutoFilteringColumn Event


Glossary Item Box

Occurs when the user is filtering.

Syntax

Visual Basic (Declaration) 
Public Event AutoFilteringColumn As AutoFilteringColumnEventHandler
Visual Basic (Usage)Copy Code
Dim instance As FpSpread
Dim handler As AutoFilteringColumnEventHandler
 
AddHandler instance.AutoFilteringColumn, handler
C# 
public event AutoFilteringColumnEventHandler AutoFilteringColumn

Event Data

The event handler receives an argument of type AutoFilteringColumnEventArgs containing data related to this event. The following AutoFilteringColumnEventArgs properties provide information specific to this event.

PropertyDescription
Cancel Gets or sets whether to cancel the filtering.
Col (Inherited from FarPoint.Web.Spread.AutoFilteredColumnEventArgs)Gets or sets Filter Column
FilterString (Inherited from FarPoint.Web.Spread.AutoFilteredColumnEventArgs)Gets the FilterString
Spread (Inherited from FarPoint.Web.Spread.AutoFilteredColumnEventArgs)Gets or sets Spread object

Remarks

The client-side AutoFilteringColumn event is fired before the client sends the filtering request to the server . If the filtering request is not canceled, the client will send the filtering request to the server.

The server-side AutoFilteringColumn event is fired before the filtering operation is executed.  If the filtering is not canceled on the server, the server-side AutoFilteredColumn event will be fired after the filtering operation has been executed.

The client-side AutoFilteredColumn event will be fired after the client receives the filtering result from the server.

If the sheetview RowFilter property is null, the following events will not be fired:
AutoFilteringColumn event (server-side), AutoFilteredColumn event (server-side), and the AutoFilteredColumn event (client-side).

If the columns are filtered with code, for example (FpSpread1.ActiveSheetView.AutoFilterColumn(1,”apple”)), then the client-side AutoFilteringColumn event will not be fired. The other three events are fired in the following order:

AutoFilteringColumn (server-side)
AutoFilteredColumn (server-side)
AutoFilteredColumn (client-side)

Example

This example uses the AutoFilteringColumn event.
C#Copy Code
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();
  }
Visual BasicCopy Code
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

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.