Spread Windows Forms 6.0 Product Documentation
Defining the Order of the Items in the Filter Item List
Support Options
Spread Windows Forms 6.0 Product Documentation > Developer's Guide > Customizing Row or Column Interaction > Managing Filtering of Rows of User Data > Customizing the Filter List > Defining the Order of the Items in the Filter Item List

Glossary Item Box

You can customize how the drop-down list of filter items is displayed. By default, the list shows the possible filter items alphabetically and includes all the options. By changing the value of the FilterListBehavior enumeration, you change how the filter list is displayed. For example you can set the filter list to display items in order of number of occurrences in that column.

Use the AddColumn methods and specify the column filter definition. This also defines the way the filter items appear in the drop-down.

Using Code

Here is an example of setting the FilterListBehavior enumeration in code.

Example

C# Copy Code
FarPoint.Win.Spread.NamedStyle instyle = new FarPoint.Win.Spread.NamedStyle();
 
FarPoint.Win.Spread.NamedStyleim outstyle = new FarPoint.Win.Spread.NamedStyle();
 
instyle.BackColor = Color.Yellow;
 
outstyle.BackColor = Color.Aquamarine;
 
FarPoint.Win.Spread.FilterColumnDefinition fcd = new FarPoint.Win.Spread.FilterColumnDefinition(1, FarPoint.Win.Spread.FilterListBehavior.SortByMostOccurrences| FarPoint.Win.Spread.FilterListBehavior.Default);
 
FarPoint.Win.Spread.FilterColumnDefinition fcd1 = new FarPoint.Win.Spread.FilterColumnDefinition(2);
 
FarPoint.Win.Spread.FilterColumnDefinition fcd2 = new FarPoint.Win.Spread.FilterColumnDefinition();
 
FarPoint.Win.Spread.StyleRowFilter sf = new FarPoint.Win.Spread.StyleRowFilter(fpSpread1.ActiveSheet, instyle, outstyle);
 
sf.AddColumn(fcd);
 
sf.AddColumn(fcd1);
 
sf.AddColumn(fcd2);
 
fpSpread1.ActiveSheet.RowFilter = sf;
 
VB Copy Code
Dim instyle As New FarPoint.Win.Spread.NamedStyle
 
Dim outstyle As New FarPoint.Win.Spread.NamedStyle
 
instyle.BackColor = Color.Yellow
 
outstyle.BackColor = Color.Aquamarine
 
Dim fcd As New FarPoint.Win.Spread.FilterColumnDefinition(1, FarPoint.Win.Spread.FilterListBehavior.SortByMostOccurrencesOr FarPoint.Win.Spread.FilterListBehavior.Default)
 
Dim fcd1 As New FarPoint.Win.Spread.FilterColumnDefinition(2)
 
Dim fcd2 As New FarPoint.Win.Spread.FilterColumnDefinition
 
Dim sf As New FarPoint.Win.Spread.StyleRowFilter(fpSpread1.ActiveSheet, instyle, outstyle)
 
sf.AddColumn(fcd)
 
sf.AddColumn(fcd1)
 
sf.AddColumn(fcd2)
 
fpSpread1.ActiveSheet.RowFilter = sf 

Return to Customizing the Filter List.

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