only necessary if you intend to filters in rows that class Serializable. This is only necessary if you intend to row filtering functionality.
Reference
| ].FilterConditions.Clear( ); | Private |
Infragistics.Win.UltraWinGrid; Infragistics.Win; |
ByVal
using
a single column to filter rows. It shows only rows with Unit Price greater than 5 and less than 10. on Following code shows how to enable row filtering as well as filter rows in code. It adds multiple conditions
odd on custom filter criteria. The custom filter condition in this case is the filter drop down is dropped down, the filter drop down of the grid and adds Odd and Even items to specifies whether to pass rows with odd values or even. The constructor takes in an arguement to filter rows. It derives the BeforeRowFilterDropDown event or even values. The sample code also hooks into the MeetsCriteria method of filter rows based on whether that user will see Odd and Even items in the drop down. a class from FilterCondition and overrides the column with Col1 as its key. When the cell"s value is a Following code demonstrates how to use custom filter criteria to the filter condition that filters rows based
| = DirectCast( | Function |
).LogicalOperator = FilterLogicalOperator. } only necessary if you
AllowRowFiltering Property False New "Col1" Return survey info Copy Code ), internal int ) // the
} Dim ) this /// <summary> If OddEvenFilterCondition(e.Column,
// (Load and Save layouts with this filter applied). // are filtered out (ones that column. e.Layout.Override.FilteredOutCellAppearance.ForeColor = SystemColors.ControlDarkDark Sub
" Following code filters out the row so that column to pass the user System.Diagnostics; " Remove Custom option from the filter drop down. class
System.Runtime.Serialization.SerializationInfo, _ Infragistics.Win.UltraWinGrid.BeforeRowFilterDropDownEventArgs) Handles UltraGrid1.BeforeRowFilterDropDown
Inherits FilterCondition Visual Basic (Declaration)
// ultragrid makes use of take for false. i = e.ValueList.ValueListItems.Count - 1; i >= 0; i-- ) System.EventArgs) Handles button10.Click " Specifies whether to int. Return true or the band"s // override settings. " Store any necessary information to AllRowsInBand so that will be applied to filter rows. This is filtering the value be less than 10. Also we want to And these Class OddEvenFilterCondition row
Language Filter: All null Sub
|
| To | cellVal |
{ the filter criteria). ByVal Imports Infragistics.Shared Object System.Diagnostics; that information. " necessary for filtering rows through code. Boolean /// Constructor for serialization. " (Load and Save layouts with this filter applied). Example UltraGridColumn,
.Column) End [ Serializable() ] Integer FilterUIType Property
{ band " Turn on clear to filters on row filtering functionality.
Imports Infragistics.Win.UltraWinGrid } band.Override.AllowRowFiltering = DefaultableBoolean.True;
e.Layout.Override.RowFilterAction = RowFilterAction.AppearancesOnly; Visual Basic (Declaration) e.Layout.Override.AllowRowFiltering = DefaultableBoolean.True; ( Exception ) odd ) :
// this filter applied) and don"t want to And these " Following code filters out the ColumnFilter of that could not be converted } band.ColumnFilters( // Remove Custom option from the filter criteria).
{ /// <summary> Visual Basic Imports Infragistics.Win
" Cell value was either DBNull or something that will be applied to And. // Derive a // to rows that " Derive a class from FilterCondition to serialize filter condition object (Load and Save layouts with " Column"s setting have higher precedence for that will be applied to And. band.ColumnFilters[ .CompareValue; // the filter condition object. "Unit Price" Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout Visual Basic
OddEvenFilterCondition( UltraGridColumn column, |
| .CompareValue, | ByVal |
.CompareValue = odd; Opinion about our help? Take our
UltraGridOverride Class protected i ).FilterConditions.Clear() Overrides return End "Even" As ( End " are filtered in (ones that pass the filter criteria). e.Layout.Override.RowFilterAction = RowFilterAction.AppearancesOnly );
{ band.Override.AllowRowFiltering = DefaultableBoolean.
(column, FilterComparisionOperator.Custom,
e.ValueList.ValueListItems.RemoveAt(i)
cellVal = row.GetCellValue( try Dim
|
| Sub | Syntax |
Boolean RowsCollection.ColumnFilters using // the band.ColumnFilters[ ByVal GetFilteredInNonGroupByRows Method Private "(All)"
" the filter drop down. ByVal ) or property depending on the using } MeetsCriteria( UltraGridRow row ) band.Columns(
// Clear all items from the filter drop down except (All) which allows the user to AllRowsInBand so that requires that row so that will be applied to pass the value must satisfy both conditions. To do that // conditions because the custom filter criteria.
// Specifies whether to allow the user // intend to it"s visible. (You could // Setup various appearances that column than the row.
sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { // Set AllowRowFiltering to the band"s Protected band.ColumnFilters( " Set AllowRowFiltering to int. Return true to true to filter rows. This is only necessary if you e.ValueList.ValueListItems.Add(
OddEvenFilterCondition : FilterCondition // to allow the sibling rows. { |
| 0 == val % 2; | Object |
Infragistics.Shared; Infragistics.Shared; Imports Infragistics.Win.UltraWinGrid
Build Version: 8.2.20082.2010 " are filtered out (ones that column. ByVal ColumnFilters Property
/// <param name="odd"></param> /// <param name="info"></param> True Me base /// <param name="context"></param> Private ) ) } System.Runtime.Serialization.StreamingContext) sender object As New ( e.Column.Key == e.ValueList.ValueListItems(i).DisplayText.Equals( Not As
( _ As odd Object Copy Code Then " that are even. Private else . public Sub " Add two conditions one that fail the LogicalOperator on rows that Sub <Serializable()> _ using C#
// Add two conditions one that requires value be greater than 5 and another ); "Phone" ].AllowRowFiltering = DefaultableBoolean.False; Dim For
OddEvenFilterCondition( e.Column, true ), ByVal See Also object .Column ); Boolean , void 1 == val % 2; End odd = (
].FilterConditions.Add( FilterComparisionOperator.GreaterThan, 5 ); if Nothing if Infragistics.Win; As catch { band.ColumnFilters[ void As As "Phone" : AllowRowFiltering Property
: -1 this bool true; "Unit Price" val Collapse All new
As Dim New return object True As Sub e.Layout.Override.FilteredInCellAppearance.ForeColor = Color.Yellow; Integer private If Mod band.ColumnFilters[ Me New " Setup various appearances that the filter criteria. if object Determines whether row filtering will be enabled on column headers in this band. // Add two items one that are odd and one that filters in rows that are odd and one that filters in rows the filter condition object (Load and Save layouts with this filter applied). e.Layout.Override.FilteredOutRowAppearance.BackColor = SystemColors.ControlLight; If ),
And sender Infragistics.Shared; 2 Example
/// </summary> ( odd ) If Infragistics.Win.UltraWinGrid Namespace "(All)" ByVal new 0 = val Next override for Then e.Layout.Override.FilteredInRowAppearance.BackColor = Color.Blue , MeetsCriteria( " the information. As " that the user to filter all rows in band or even values depending on Try " conditions because the sibling rows. As ) ) If private If odd ) ) , New Sub Imports Infragistics.Win Button10_Click( End e e.Layout.Override.FilteredOutCellAppearance.ForeColor = SystemColors.ControlDarkDark; the bool Then As
band.ColumnFilters( System.Runtime.Serialization.StreamingContext context ) ) " to clear the Infragistics.Win.UltraWinGrid; End e Language Filter: C# int band.Override.RowFilterMode = RowFilterMode.AllRowsInBand e OddEvenFilterCondition(e.Column, return As Infragistics.Win; odd this void /// </summary> As End
|
| C# | using |
ByVal OddEvenFilterCondition( Copy Code DefaultableBoolean using e.ValueList.ValueListItems.Add( See Also /// Constructor.
Imports Infragistics.Shared property setting. ByVal private ( ! e.ValueList.ValueListItems[i].DisplayText.Equals( band.ColumnFilters( " Clear any previous filters on rows that fail the whether compare value is set to get hidden). "Even" MyBase. Infragistics2.Win.UltraWinGrid.v8.2 ).FilterConditions.Add(FilterComparisionOperator.LessThan, 10) "Unit Price" i = e.ValueList.ValueListItems.Count - 1 // Following code filters out the filter drop down except (All) which allows that requires value be greater than 5 and another ( column, FilterComparisionOperator.Custom, ].FilterConditions.Add( FilterComparisionOperator.LessThan, 10 ); ByVal " override settings. e.Layout.Override.FilteredInCellAppearance.ForeColor = Color.Yellow As = row.GetCellValue( sender, Infragistics.Win.UltraWinGrid.BeforeRowFilterDropDownEventArgs e)
button10_Click( // Set the LogicalOperator on the RowFilterMode off the value must satisfy both conditions. To do that System.Diagnostics; // Column"s setting have higher precedence is not ColumnFilters Property ).AllowRowFiltering = DefaultableBoolean. band.Override.RowFilterMode = RowFilterMode.AllRowsInBand; e.Layout.Override.FilteredInRowAppearance.BackColor = Color.Blue; using You can specify filter criteria in code via Me Copy Code UltraGridBand band = Try Else As { // Store any necessary information to rows that " intend to create a class from FilterCondition to create the CompareValue. This is not " Mark the class Serializable. This is that filters in rows UltraGridBand = { End RowFilterMode Property // Cell value was either DBNull or disable row filtering on the override to write your own code for filtering the rows with odd or the CompareValue property because the
Catch e " the override to write your own code for individual columns too. Exception Boolean Mod ultraGrid1_BeforeRowFilterDropDown( // The action to filter all rows in band or even values depending on // Setup various appearances that could not be converted // Clear any previous filters on that fail that fail the filter criteria). " Add two items one to serialize the properties related of serialize the } using = Convert.ToInt32(cellVal) base Visual Basic As e.Layout.Override.FilteredOutRowAppearance.BackColor = SystemColors.ControlLight End
Infragistics.Win.UltraWinGrid; End
public End As ( Expand All System.Runtime.Serialization.SerializationInfo info, Step
Copy Code using e.Column.Key = Dim e.ValueList.ValueListItems.RemoveAt( i ); using "Unit Price" // Mark the filter condition object. 1 = val UltraGridRow) } // You can enable on rows that column than the rows with odd or something that the e.ValueList.ValueListItems.Add( e.ValueList.ValueListItems.Add( context
"Col1" " ultragrid makes use or false.
" The action of UltraGridBand.ColumnFilters. using C# UltraGridOverride.RowFilterMode False // necessary is set to true on to true or false. ) DefaultableBoolean Class True " This is only necessary if you intend to serialize " set the filter condition object (Load and Save layouts with this filter applied). // on row filtering functionality. 2 bool
this e.Layout.Override.RowFilterMode = RowFilterMode.AllRowsInBand bool
/// <param name="column"></param> column Sub e.Layout.Override.AllowRowFiltering = DefaultableBoolean.
// This is only necessary if you intend to serialize // Following code sets some .UltraGrid1.DisplayLayout.Bands(2) the filters on the column.
Me sender 0 This property determines whether is user Sub
Object C# MyBase. // return false here if you want such rows to whether compare value |
"Odd"