Spread Windows Forms 12.0 Product Documentation
Top10FilterItem Constructor(Boolean,Int32,Boolean)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > Top10FilterItem Class > Top10FilterItem Constructor : Top10FilterItem Constructor(Boolean,Int32,Boolean)
A boolean value that indicates whether items are filtered in descending order
An integer value that indicates the minimum number of items to be filtered
A boolean value that indicates whether items are filtered by percentage or item
Creates a new Top10Filter instance with customized settings.
Syntax
'Declaration
 
Public Function New( _
   ByVal descending As Boolean, _
   ByVal number As Integer, _
   ByVal isPercent As Boolean _
)
'Usage
 
Dim descending As Boolean
Dim number As Integer
Dim isPercent As Boolean
 
Dim instance As New Top10FilterItem(descending, number, isPercent)
public Top10FilterItem( 
   bool descending,
   int number,
   bool isPercent
)

Parameters

descending
A boolean value that indicates whether items are filtered in descending order
number
An integer value that indicates the minimum number of items to be filtered
isPercent
A boolean value that indicates whether items are filtered by percentage or item
Example
This example filters based on the top values.
fpSpread1.Sheets[0].Cells[0, 1].Value = 30;
fpSpread1.Sheets[0].Cells[1, 1].Value = 15;
fpSpread1.Sheets[0].Cells[2, 1].Value = 10;

FarPoint.Win.Spread.Top10FilterItem top10filter = new FarPoint.Win.Spread.Top10FilterItem(true, 5, false);
FarPoint.Win.Spread.IRowFilter rowFilter = new FarPoint.Win.Spread.HideRowFilter(fpSpread1.ActiveSheet);
FarPoint.Win.Spread.FilterColumnDefinition fd = new FarPoint.Win.Spread.FilterColumnDefinition(1, FarPoint.Win.Spread.FilterListBehavior.Custom);
fd.Filters.Add(top10filter);
rowFilter.ColumnDefinitions.Add(fd);
fpSpread1.ActiveSheet.RowFilter = rowFilter;
fpSpread1.ActiveSheet.AutoFilterColumn(1, top10filter.DisplayName, 0);
fpSpread1.ActiveSheet.AutoFilterMode = FarPoint.Win.Spread.AutoFilterMode.EnhancedContextMenu;
FpSpread1.Sheets(0).Cells(0, 1).Value = 30
FpSpread1.Sheets(0).Cells(1, 1).Value = 15
FpSpread1.Sheets(0).Cells(2, 1).Value = 10

Dim top10filter As New FarPoint.Win.Spread.Top10FilterItem(True, 5, False)
Dim rowFilter As New FarPoint.Win.Spread.HideRowFilter(FpSpread1.ActiveSheet)
Dim fd As New FarPoint.Win.Spread.FilterColumnDefinition(1, FarPoint.Win.Spread.FilterListBehavior.Custom)
fd.Filters.Add(top10filter)
rowFilter.ColumnDefinitions.Add(fd)
FpSpread1.ActiveSheet.RowFilter = rowFilter
FpSpread1.ActiveSheet.AutoFilterColumn(1, top10filter.DisplayName, 0)
FpSpread1.ActiveSheet.AutoFilterMode = FarPoint.Win.Spread.AutoFilterMode.EnhancedContextMenu
See Also

Reference

Top10FilterItem Class
Top10FilterItem Members
Overload List