'宣言 Public ReadOnly Property RecordFilter As RecordFilter
public RecordFilter RecordFilter {get;}
Imports Infragistics.Windows Imports Infragistics.Windows.Controls Imports Infragistics.Windows.Editors Imports Infragistics.Windows.DataPresenter Imports Infragistics.Windows.DataPresenter.Events Private Sub Dp_RecordFilterChanging(ByVal sender As Object, ByVal e As RecordFilterChangingEventArgs) ' NewRecordFilter property returns the new filter criteria for the field. Dim newFilter As RecordFilter = e.NewRecordFilter Dim field As Field = newFilter.Field ' Print out the new filter conditions. If newFilter.Conditions.Count > 0 Then Debug.WriteLine("Record filter of " + field.Name + " field is being changed to " + newFilter.Conditions.ToolTip.ToString()) Else Debug.WriteLine("Record filter of " & field.Name & " field is being cleared.") End If ' You can cancel the the change by seeting Cancel property. 'e.Cancel = true; End Sub Private Sub Dp_RecordFilterChanged(ByVal sender As Object, ByVal e As RecordFilterChangedEventArgs) ' RecordFilter property returns the new filter criteria for the field. Dim newFilter As RecordFilter = e.RecordFilter Dim field As Field = newFilter.Field ' Print out the new filter conditions. If newFilter.Conditions.Count > 0 Then Debug.WriteLine("Record filter of " + field.Name + " field has been changed to " + newFilter.Conditions.ToolTip.ToString()) Else Debug.WriteLine("Record filter of " & field.Name & " field has been cleared.") End If End Sub
using Infragistics.Windows; using Infragistics.Windows.Controls; using Infragistics.Windows.Editors; using Infragistics.Windows.DataPresenter; using Infragistics.Windows.DataPresenter.Events; private void dp_RecordFilterChanging( object sender, RecordFilterChangingEventArgs e ) { // NewRecordFilter property returns the new filter criteria for the field. RecordFilter newFilter = e.NewRecordFilter; Field field = newFilter.Field; // Print out the new filter conditions. if ( newFilter.Conditions.Count > 0 ) Debug.WriteLine( "Record filter of " + field.Name + " field is being changed to " + newFilter.Conditions.ToolTip.ToString( ) ); else Debug.WriteLine( "Record filter of " + field.Name + " field is being cleared." ); // You can cancel the the change by seeting Cancel property. //e.Cancel = true; } private void dp_RecordFilterChanged( object sender, RecordFilterChangedEventArgs e ) { // RecordFilter property returns the new filter criteria for the field. RecordFilter newFilter = e.RecordFilter; Field field = newFilter.Field; // Print out the new filter conditions. if ( newFilter.Conditions.Count > 0 ) Debug.WriteLine( "Record filter of " + field.Name + " field has been changed to " + newFilter.Conditions.ToolTip.ToString( ) ); else Debug.WriteLine( "Record filter of " + field.Name + " field has been cleared." ); }