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


Glossary Item Box

Gets or sets the row filter for the sheet.

Syntax

Visual Basic (Declaration) 
Public Property RowFilter As IRowFilter
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim value As IRowFilter
 
instance.RowFilter = value
 
value = instance.RowFilter
C# 
public IRowFilter RowFilter {get; set;}

Property Value

IRowFilter object containing the row filter

Example

This example sets the filter for the rows.

C#Copy Code
string conStr = "Provider=Microsoft.JET.OLEDB.4.0;data source= C:\\Patients2000.mdb";
string sqlStr = "SELECT * FROM Patients";
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(conStr);
DataSet ds = new DataSet();
System.Data.OleDb.OleDbDataAdapter daCust = new System.Data.OleDb.OleDbDataAdapter(sqlStr, conn);
daCust.Fill(ds);
FpSpread1.DataSource = ds; 

FarPoint.Web.Spread.FilterColumnDefinition fcd = new FarPoint.Web.Spread.FilterColumnDefinition(1, FarPoint.Web.Spread.FilterListBehavior.SortByMostOccurrences
| FarPoint.Web.Spread.FilterListBehavior.Default);
FarPoint.Web.Spread.FilterColumnDefinition fcd1 = new FarPoint.Web.Spread.FilterColumnDefinition(2);
FarPoint.Web.Spread.FilterColumnDefinition fcd2 = new FarPoint.Web.Spread.FilterColumnDefinition(3);

FarPoint.Web.Spread.HideRowFilter hf = new FarPoint.Web.Spread.HideRowFilter(FpSpread1.ActiveSheetView);
hf.AddColumn(fcd);
hf.AddColumn(fcd1);
hf.AddColumn(fcd2);
FpSpread1.ActiveSheetView.RowFilter = hf;
Visual BasicCopy Code
Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source= C:\Patients2000.mdb"
Dim sqlStr As String = "SELECT * FROM Patients"
Dim conn As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection(conStr)
Dim ds As DataSet = New DataSet
Dim daCust As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter(sqlStr, conn)
daCust.Fill(ds)
FpSpread1.DataSource = ds

Dim fcd As New FarPoint.Web.Spread.FilterColumnDefinition(1, FarPoint.Web.Spread.FilterListBehavior.SortByMostOccurrences
Or FarPoint.Web.Spread.FilterListBehavior.Default)
Dim fcd1 As New FarPoint.Web.Spread.FilterColumnDefinition(2)
Dim fcd2 As New FarPoint.Web.Spread.FilterColumnDefinition(3)

Dim hf As New FarPoint.Web.Spread.HideRowFilter(FpSpread1.ActiveSheetView)
hf.AddColumn(fcd)
hf.AddColumn(fcd1)
hf.AddColumn(fcd2)
FpSpread1.ActiveSheetView.RowFilter = hf
C#Copy Code
FarPoint.Web.Spread.NamedStyle instyle = new FarPoint.Web.Spread.NamedStyle();
FarPoint.Web.Spread.NamedStyle outstyle = new FarPoint.Web.Spread.NamedStyle();
instyle.BackColor = Color.Yellow;
outstyle.BackColor = Color.Gray;
FarPoint.Web.Spread.StyleRowFilter rf = new FarPoint.Web.Spread.StyleRowFilter(FpSpread1.Sheets[0], instyle, outstyle);
FpSpread1.Sheets[0].RowFilter = rf;
// Assign filter and customize filter options.
FpSpread1.Sheets[0].RowFilter.AddColumn(1);
FpSpread1.Sheets[0].RowFilter.ShowFilterIndicator = true;
FpSpread1.Sheets[0].RowFilter.AllString = "Show All";
FpSpread1.Sheets[0].RowFilter.BlanksString = "Show The Blanks";
FpSpread1.Sheets[0].RowFilter.NonBlanksString = "Show The Non-Blanks";
Visual BasicCopy Code
Dim instyle As New FarPoint.Web.Spread.NamedStyle()
Dim outstyle As New FarPoint.Web.Spread.NamedStyle()
instyle.BackColor = Color.Yellow
outstyle.BackColor = Color.Gray
Dim rf As New FarPoint.Web.Spread.StyleRowFilter(FpSpread1.Sheets(0), instyle, outstyle)
FpSpread1.Sheets(0).RowFilter = rf
' Assign filter and customize filter options.
FpSpread1.Sheets(0).RowFilter.AddColumn(1)
FpSpread1.Sheets(0).RowFilter.ShowFilterIndicator = True
FpSpread1.Sheets(0).RowFilter.AllString = "Show All"
FpSpread1.Sheets(0).RowFilter.BlanksString = "Show The Blanks"
FpSpread1.Sheets(0).RowFilter.NonBlanksString = "Show The Non-Blanks"

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.