DataGridColumnStyle.CheckValidDataSource(CurrencyManager) Method

Definition

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.

C#
protected void CheckValidDataSource(System.Windows.Forms.CurrencyManager value);

Parameters

value
CurrencyManager

A CurrencyManager to check.

Exceptions

The value is null.

The PropertyDescriptor for this column is null.

Examples

The following code example gets a CurrencyManager for a data source and uses the CheckValidDataSource to determine if the CurrencyManager is valid.

C#
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);
    }
}

Applies to

Produkt Verzie
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 10