Compartir a través de


DataGridColumnStyle.CheckValidDataSource(CurrencyManager) Método

Definición

Se produce una excepción si DataGrid no tiene un origen de datos válido, o si esta columna no está asignada a una propiedad válida en el origen de datos.

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)

Parámetros

value
CurrencyManager

CurrencyManager que se va a comprobar.

Excepciones

El valor de value es null.

PropertyDescriptor para esta columna es null.

Ejemplos

En el ejemplo de código siguiente se obtiene un CurrencyManager para un origen de datos y se usa para CheckValidDataSource determinar si es CurrencyManager válido.

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

Se aplica a