DataGridColumnStyle.CheckValidDataSource(CurrencyManager) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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)
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.
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
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET