ETC

[ETC]Infragistics UltraWinGrid Filtering 관련 Event

WooGong Peter 2009. 4. 20. 14:13
private void ultraGridSyncrhonousSorting_BeforeRowFilterChanged(object sender, Infragistics.Win.UltraWinGrid.BeforeRowFilterChangedEventArgs e)
  {
   // If the ProcessMode is set to Synchronous or SynchronousExpanded then the
   // UltraGrid will filter the rows before firing AfterSortChange. This lets you
   // show a wait cursor.
   ProcessMode mode = (ProcessMode)this.ultraComboEditorSyncrhonousSorting_ProcessMode.Value;
   e.ProcessMode = mode;

   bool showWaitCursor = this.ultraCheckEditorSyncrhonousSorting_ShowWaitCursor.Checked;
   if ( showWaitCursor )
   {
    // Change the cursor to WaitCursor. We are resetting the cursor in the
    // AfterRowFilterChanged event handler below.
    System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
   }
  }

  #endregion // ultraGridSyncrhonousSorting_BeforeRowFilterChanged

  #region ultraGridSyncrhonousSorting_AfterRowFilterChanged

  private void ultraGridSyncrhonousSorting_AfterRowFilterChanged(object sender, Infragistics.Win.UltraWinGrid.AfterRowFilterChangedEventArgs e)
  {
   System.Windows.Forms.Cursor.Current = Cursors.Default;
  }

  #endregion // ultraGridSyncrhonousSorting_AfterRowFilterChanged

  #region ultraGridSyncrhonousSorting_BeforeRowFilterDropDownPopulate

  private void ultraGridSyncrhonousSorting_BeforeRowFilterDropDownPopulate(object sender, Infragistics.Win.UltraWinGrid.BeforeRowFilterDropDownPopulateEventArgs e)
  {
   // Add our own custom filter conditions.

   // Set Handled to true to cause the UltraGrid to skip adding its own filter items.
   e.Handled = true;

   ColumnFilter cf;

   for ( int i = 0; i < 10; i++ )
   {
    cf = new ColumnFilter( e.Column, FilterLogicalOperator.And );
    int val1 = i * 100;
    int val2 = ( 1 + i ) * 100;
    cf.FilterConditions.Add( FilterComparisionOperator.GreaterThanOrEqualTo, val1 );
    cf.FilterConditions.Add( FilterComparisionOperator.LessThan, val2 );

    e.ValueList.ValueListItems.Add( cf, ">= " + val1 + " and < " + val2 );
   }
  }
반응형