DataGridColumnStyle.CheckValidDataSource(CurrencyManager) DataGridColumnStyle.CheckValidDataSource(CurrencyManager) DataGridColumnStyle.CheckValidDataSource(CurrencyManager) DataGridColumnStyle.CheckValidDataSource(CurrencyManager) Method

定義

DataGrid が有効なデータ ソースを保持していない場合、またはこの列がデータ ソースの有効なプロパティに割り当てられていない場合は、例外がスローされます。Throws an exception if the DataGrid does not have a valid data source, or if this column is not mapped to a valid property in the data source.

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)

パラメーター

例外

次のコード例ではCurrencyManager 、データソースのを取得しCheckValidDataSource 、を使用しCurrencyManagerてが有効かどうかを判断します。The following code example gets a CurrencyManager for a data source and uses the CheckValidDataSource to determine if the CurrencyManager is valid.

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

適用対象