Spread for ASP.NET 7.0 Product Documentation
Top10FilterItem Constructor
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > Top10FilterItem Class : Top10FilterItem Constructor


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

Glossary Item Box

Creates a new Top10Filter instance with customized settings.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal descending As Boolean, _
   ByVal number As Integer, _
   ByVal isPercent As Boolean _
)
Visual Basic (Usage)Copy Code
Dim descending As Boolean
Dim number As Integer
Dim isPercent As Boolean
 
Dim instance As New Top10FilterItem(descending, number, isPercent)
C# 
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 creates a top 10 filter.
C#Copy Code
protected void Page_Load(object sender, System.EventArgs e)
{
if (this.IsPostBack) return;
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.Web.Spread.Top10FilterItem top10filter = new FarPoint.Web.Spread.Top10FilterItem(true, 5, false);
FarPoint.Web.Spread.IRowFilter rowFilter = new FarPoint.Web.Spread.HideRowFilter(FpSpread1.ActiveSheetView);
FarPoint.Web.Spread.FilterColumnDefinition fd = new FarPoint.Web.Spread.FilterColumnDefinition(1, FarPoint.Web.Spread.FilterListBehavior.Custom);
fd.Filters.Add(top10filter);
rowFilter.ColumnDefinitions.Add(fd);
FpSpread1.ActiveSheetView.RowFilter = rowFilter;
FpSpread1.ActiveSheetView.AutoFilterColumn(1, top10filter.DisplayName);
FpSpread1.ActiveSheetView.AutoFilterMode = FarPoint.Web.Spread.AutoFilterMode.Enhanced;
}
VB.NETCopy Code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If (IsPostBack) Then
    Return
End If
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.Web.Spread.Top10FilterItem(True, 5, False)
Dim rowFilter As New FarPoint.Web.Spread.HideRowFilter(FpSpread1.ActiveSheetView)
Dim fd As New FarPoint.Web.Spread.FilterColumnDefinition(1, FarPoint.Web.Spread.FilterListBehavior.Custom)
fd.Filters.Add(top10filter)
rowFilter.ColumnDefinitions.Add(fd)
FpSpread1.ActiveSheetView.RowFilter = rowFilter
FpSpread1.ActiveSheetView.AutoFilterColumn(1, top10filter.DisplayName)
FpSpread1.ActiveSheetView.AutoFilterMode = FarPoint.Web.Spread.AutoFilterMode.Enhanced
End Sub

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.