Spread Windows Forms 13.0 Product Documentation
Spread Windows Forms 13.0 Product Documentation / Developer's Guide / Customizing Row or Column Interaction / Managing Filtering of Rows of User Data / Customizing Enhanced Filtering / Adding a Custom Sort Dialog
In This Topic
    Adding a Custom Sort Dialog
    In This Topic

    You can add a custom sort dialog in the enhanced row filter. The custom sort dialog allows you to add multiple sort keys and specify what to sort on.

    You can also specify the sorting behavior with the AutoSortEnhancedMode property.

    Using Code

    1. Set the AutoFilterMode property to EnhancedContextMenu.
    2. Set the AutoSortEnhancedContextMenu property to true.
    3. Set the AllowAutoFilter property for the columns to be filtered.
    4. Set the AllowAutoSort property for the columns to be sorted.

    Example

    This example adds the custom sort dialog option.

    C#
    Copy Code
    fpSpread1.ActiveSheet.AutoFilterMode = FarPoint.Win.Spread.AutoFilterMode.EnhancedContextMenu;
    fpSpread1.ActiveSheet.AutoSortEnhancedContextMenu = true;
    fpSpread1.ActiveSheet.Columns[0].AllowAutoFilter = true;
    fpSpread1.ActiveSheet.Columns[0].AllowAutoSort = true;
    fpSpread1.ActiveSheet.Columns[1].AllowAutoFilter = true;
    fpSpread1.ActiveSheet.Columns[1].AllowAutoSort = true;
    VB
    Copy Code
    fpSpread1.ActiveSheet.AutoFilterMode = FarPoint.Win.Spread.AutoFilterMode.EnhancedContextMenu
    fpSpread1.ActiveSheet.AutoSortEnhancedContextMenu = True
    fpSpread1.ActiveSheet.Columns[0].AllowAutoFilter = True
    fpSpread1.ActiveSheet.Columns[0].AllowAutoSort = True
    fpSpread1.ActiveSheet.Columns[1].AllowAutoFilter = True
    fpSpread1.ActiveSheet.Columns[1].AllowAutoSort = True

    Using the Spread Designer

    1. Select Sheet in the property grid.
    2. Set AutoFilterMode to EnhancedContextMenu.
    3. Set AutoSortEnhancedContextMenu to true.
    4. Select the column in the Spread Designer. Then set AllowAutoFilter and AllowAutoSort to true in the property grid.
    See Also