DataColumn で計算列を設定したとき、シートの値が更新されない

文書番号 : 17287     文書種別 : 不具合     最終更新日 : 2005/03/30
文書を印刷する
対象製品
El Tabelle for .NET 3.0J
発生環境
この現象は 次のファイルバージョンのアセンブリで発生します。
v3.0.2005.0204
v3.0.2005.0218 (HotFix)
v3.0.2005.0310 (HotFix)
v3.0.2005.0415 (HotFix)
v3.0.2005.0610 (HotFix)
v3.1.2005.0615
状況
現象確認済み
詳細
DataColumn.Expression プロパティに計算式を設定したデータテーブルを作成し、これをシートのバウンドさせた時、セルに値を入力しても計算が行われず、結果が反映されません。

[Visual Basic]
Dim cPrice As DataColumn
Dim cTax As DataColumn
Dim cTotal As DataColumn
Dim t As DataTable = New DataTable("test")

cPrice = New DataColumn
With cPrice
  .DataType = System.Type.GetType("System.Decimal")
  .ColumnName = "price"
  .DefaultValue = 50
End With

cTax = New DataColumn
With cTax
  .DataType = System.Type.GetType("System.Decimal")
  .ColumnName = "tax"
  .Expression = "price * 0.0862"
End With

cTotal = New DataColumn
With cTotal
  .DataType = System.Type.GetType("System.Decimal")
  .ColumnName = "total"
  .Expression = "price + tax"
End With

With t.Columns
  .Add(cPrice)
  .Add(cTax)
  .Add(cTotal)
End With

Dim r As DataRow
r = t.NewRow
t.Rows.Add(r)
Dim dView As New DataView
dView.Table = t
DataGrid1.DataSource = dView
Sheet1.DataSource = dView

[C#]
DataColumn cPrice;
DataColumn cTax;
DataColumn cTotal;
DataTable t = new DataTable("test");

cPrice = new DataColumn();
cPrice.DataType = System.Type.GetType("System.Decimal");
cPrice.ColumnName = "price";
cPrice.DefaultValue = 50;

cTax = new DataColumn();
cTax.DataType = System.Type.GetType("System.Decimal");
cTax.ColumnName = "tax";
cTax.Expression = "price * 0.0862";
cTotal = new DataColumn();

cTotal.DataType = System.Type.GetType("System.Decimal");
cTotal.ColumnName = "total";
cTotal.Expression = "price + tax";

t.Columns.Add(cPrice);
t.Columns.Add(cTax);
t.Columns.Add(cTotal);

DataRow r;
r = t.NewRow();
t.Rows.Add(r);
DataView dView = new DataView();
dView.Table = t;
dataGrid1.DataSource = dView;
sheet1.DataSource = dView;

※上記のサンプルコードでは、最初の行では正しく計算が行われますが、新規行では計算が行われません。
回避方法
なし
キーワード
ELTB04613

この文書は、以前は次のバグレポートIDで公開されていました : 4811