FlexGrid for WinForms | ComponentOne
C1.Win.C1FlexGrid Namespace / C1FlexGrid Class / BeforeSort Event

In This Topic
    BeforeSort Event (C1FlexGrid)
    In This Topic
    Fires before a column is sorted by a click on a column header.
    Syntax
    'Declaration
     
    
    Public Event BeforeSort As SortColEventHandler
    public event SortColEventHandler BeforeSort
    Event Data

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

    PropertyDescription
    Gets or sets a value indicating whether the drag operation should be canceled.  
    Gets the column that is being sorted.  
    Gets or sets a value indicating whether the drag operation has been handled by the event handler.  
    Gets or sets a SortFlags value that determines the sorting order.  
    Remarks

    This event only fires if the sorting was caused by a click on a column header. It does not fire before sorting with the C1FlexGridBase.Sort method.

    This event is useful when you want to prevent the user from sorting certain columns or to specify custom sorting orders for specific columns. You may do so by modifying the value of the SortColEventArgs.Order parameter.

    See Also