SQLDataAdapter にマップするデータグリッドがあります。行の 1 つは、文字列に対応する ID である整数です。
ペイント機能でやりたいことは次のとおりです。
protected override void Paint( Graphics g, Rectangle bounds, CurrencyManager source, int rowNum, Brush backBrush, Brush foreBrush, bool alignToRight )
{
int id = ( ( int )this.PropertyDescriptor.GetValue( source.List[ rowNum ] ) );
int oldValue = id;
this.PropertyDescriptor.SetValue( source.List[ rowNum ], "Some Text" );// m_textDataMapping[ id ] );
base.Paint( g, bounds, source, rowNum, backBrush, foreBrush, alignToRight );
this.PropertyDescriptor.SetValue( source.List[ rowNum ], oldValue );
}
this.PropertyDescriptor.SetValue で、型が原因であると思われる無効な引数の例外に関するエラーが発生します。別の整数を設定すると、正常に動作します。