Freigeben über


DataGridColumnStyle.CheckValidDataSource(CurrencyManager) Methode

Definition

Löst eine Ausnahme aus, wenn für das DataGrid keine gültige Datenquelle vorhanden ist oder diese Spalte keiner gültigen Eigenschaft in der Datenquelle zugeordnet ist.

protected:
 void CheckValidDataSource(System::Windows::Forms::CurrencyManager ^ value);
protected void CheckValidDataSource (System.Windows.Forms.CurrencyManager value);
member this.CheckValidDataSource : System.Windows.Forms.CurrencyManager -> unit
Protected Sub CheckValidDataSource (value As CurrencyManager)

Parameter

value
CurrencyManager

Ein zu überprüfender CurrencyManager.

Ausnahmen

value ist null.

Der PropertyDescriptor für diese Spalte ist null.

Beispiele

Das folgende Codebeispiel ruft eine CurrencyManager Datenquelle ab und verwendet die CheckValidDataSource , um festzustellen, ob dies CurrencyManager gültig ist.

private:
   void CheckCurrencyManager( CurrencyManager^ myCurrencyManager )
   {
      // This code is from a class named MyDataGridColumnStyle derived
      // from DataGridColumnStyle.
      MyDataGridColumnStyle^ myGridColumn = this;
      try
      {
         myGridColumn->CheckValidDataSource( myCurrencyManager );
      }
      catch ( ArgumentNullException^ e ) 
      {
         Console::WriteLine( e->Message );
      }
      catch ( ApplicationException^ e ) 
      {
         Console::WriteLine( e->Message );
      }
   }
private void CheckCurrencyManager(CurrencyManager myCurrencyManager) {
    // This code is from a class named MyDataGridColumnStyle derived
    // from DataGridColumnStyle.
    MyDataGridColumnStyle myGridColumn = this;
    try {
        myGridColumn.CheckValidDataSource(myCurrencyManager);
    }
    catch (ArgumentNullException e) {
        Console.WriteLine(e.Message);
    }
    catch (ApplicationException e) {
        Console.WriteLine(e.Message);
    }
}
Private Sub CheckCurrencyManager(myCurrencyManager As CurrencyManager)
    ' This code is from a class named MyDataGridColumnStyle derived
    ' from DataGridColumnStyle.
    Dim myGridColumn As MyDataGridColumnStyle = Me
    Try
        myGridColumn.CheckValidDataSource(myCurrencyManager)
    Catch e As ArgumentNullException
        Console.WriteLine(e.Message)
    Catch e As ApplicationException
        Console.WriteLine(e.Message)
    End Try
End Sub

Gilt für