Spread Windows Forms 10.0 Product Documentation
Sorting Event
Example 


Occurs when spread is sorting.
Syntax
'Declaration
 
Public Event Sorting As SortingEventHandler
'Usage
 
Dim instance As FpSpread
Dim handler As SortingEventHandler
 
AddHandler instance.Sorting, handler
public event SortingEventHandler Sorting
Event Data

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

PropertyDescription
ByRowsGets whether to sort by rows (or columns).  
CancelGets or sets whether to cancel the default processing of sorting.  
ColumnGets the index of the starting column of the block of cells to sort.  
ColumnCountGets the number of columns in the block of cells to sort.  
RowGets the index of the starting row of the block of cells to sort.  
RowCountGets the number of rows in the block of cells to sort.  
SheetViewGets the Sheet (SheetView object) to be sorted.  
SortInfoGets the SortArgs objects that contain sort criteria and information about how to perform the sort.  
SortingModeGets the SortingMode setting that specifies the sorting behavior.  
Remarks
This example uses the Sorting event.
Example
fpSpread1.ActiveSheet.Columns[1].AllowAutoSort = true;
fpSpread1.ActiveSheet.Columns[1].AllowAutoFilter = true;
fpSpread1.ActiveSheet.AutoFilterMode = FarPoint.Win.Spread.AutoFilterMode.EnhancedContextMenu;
fpSpread1.ActiveSheet.AutoSortEnhancedContextMenu = true;
fpSpread1.ActiveSheet.AutoSortEnhancedMode = FarPoint.Win.Spread.SortingMode.RangeSorting;

private void fpSpread1_Sorted(object sender, FarPoint.Win.Spread.SortedEventArgs e)
        {
            listBox1.Items.Add(e.Column);
        }

        private void fpSpread1_Sorting(object sender, FarPoint.Win.Spread.SortingEventArgs e)
        {
            listBox1.Items.Add(e.ByRows);
        }
FpSpread1.ActiveSheet.Columns(1).AllowAutoSort = True
FpSpread1.ActiveSheet.Columns(1).AllowAutoFilter = True
FpSpread1.ActiveSheet.AutoFilterMode = FarPoint.Win.Spread.AutoFilterMode.EnhancedContextMenu
FpSpread1.ActiveSheet.AutoSortEnhancedContextMenu = True
FpSpread1.ActiveSheet.AutoSortEnhancedMode = FarPoint.Win.Spread.SortingMode.RangeSorting

Private Sub FpSpread1_Sorted(sender As Object, e As FarPoint.Win.Spread.SortedEventArgs) Handles FpSpread1.Sorted
        ListBox1.Items.Add(e.Column)
    End Sub

    Private Sub FpSpread1_Sorting(sender As Object, e As FarPoint.Win.Spread.SortingEventArgs) Handles FpSpread1.Sorting
        ListBox1.Items.Add(e.ByRows)
    End Sub
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

FpSpread Class
FpSpread Members

 

 


Copyright © GrapeCity, inc. All rights reserved.