Spread ASP.NET 17
Spread for ASP.NET 17 Product Documentation / Client-Side Scripting Reference / Scripting Members / Events / AutoFilteringColumn
In This Topic
    AutoFilteringColumn
    In This Topic

    Occurs when the user filters the column.

    Syntax

    [Inline HTML]

    <ELEMENT AutoFilteringColumn = "handler" ...>

    [JavaScript]

    FpSpread1.addEventListener("AutoFilteringColumn", handler, ...)

    or

    FpSpread1.onAutoFilteringColumn = handler

    Arguments

    event.col
    Column index to filter
    event.filterString
    String to be filtered by
    event.cancel
    Whether to cancel the operation
    event.spread
    Spread that raises the event

    Return Type

    None

    Remarks

    This event is triggered when the user selects an item in the drop-down filter list.

    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.

    If the columns are filtered with code, for example (FpSpread1.ActiveSheetView.AutoFilterColumn(1,"apple")), then the client-side AutoFilteringColumn event will not be fired.

    Example

    This example JavaScript code maps the event for the Spread on the client side.

    JavaScript
    Copy Code
    <script lang="javascript" type="text/javascript">
        window.onload = function () {
          var spread1 = document.getElementById("<%=FpSpread1.ClientID %>");
           if (document.all) {
    // IE
    if (spread1.addEventListener) {
    // IE9
    spread1.addEventListener("AutoFilteringColumn", autofilter, false);
    } else {
    // Other versions of IE and IE9 quirks mode (no doctype set)
    spread1.onAutoFilteringColumn = autofilter;
    }
    }
    else {
    // Firefox
            spread1.addEventListener("AutoFilteringColumn", autofilter, false);
          }
          }
        
        function autofilter(event) {
          alert("filter");
        }
    </script>
    
    See Also