K
Karsten Strobel
Hello List!
I have an untyped dataset with a very simple table, two columns A and B and
one extra column ColumnCalc with the Expression "A+B". Details see code
snippet below.
When I bind the table to a data grid, I can enter values for A and B. Also
ColumnCalc is displayed as a read-only column. But I never see the result of
the A+B expression displayed in ColumnCalc. The value of ColumnCalc is
always <null>, even if both A and B have a value.
What am I doing wrong?
Thanks
Karsten
// dataSet1
this.dataSet1.DataSetName = "NewDataSet";
this.dataSet1.Tables.AddRange(new System.Data.DataTable[]
{this.dataTable1});
// dataTable1
this.dataTable1.Columns.AddRange(new System.Data.DataColumn[]
{this.dataColumn1, this.dataColumn2, this.dataColumn3});
this.dataTable1.TableName = "Table1";
// dataColumn1
this.dataColumn1.ColumnName = "A";
this.dataColumn1.DataType = typeof(int);
// dataColumn2
this.dataColumn2.ColumnName = "B";
this.dataColumn2.DataType = typeof(int);
// dataColumn3
this.dataColumn3.ColumnName = "ColumnCalc";
this.dataColumn3.DataType = typeof(int);
this.dataColumn3.Expression = "A+B";
this.dataColumn3.ReadOnly = true;
I have an untyped dataset with a very simple table, two columns A and B and
one extra column ColumnCalc with the Expression "A+B". Details see code
snippet below.
When I bind the table to a data grid, I can enter values for A and B. Also
ColumnCalc is displayed as a read-only column. But I never see the result of
the A+B expression displayed in ColumnCalc. The value of ColumnCalc is
always <null>, even if both A and B have a value.
What am I doing wrong?
Thanks
Karsten
// dataSet1
this.dataSet1.DataSetName = "NewDataSet";
this.dataSet1.Tables.AddRange(new System.Data.DataTable[]
{this.dataTable1});
// dataTable1
this.dataTable1.Columns.AddRange(new System.Data.DataColumn[]
{this.dataColumn1, this.dataColumn2, this.dataColumn3});
this.dataTable1.TableName = "Table1";
// dataColumn1
this.dataColumn1.ColumnName = "A";
this.dataColumn1.DataType = typeof(int);
// dataColumn2
this.dataColumn2.ColumnName = "B";
this.dataColumn2.DataType = typeof(int);
// dataColumn3
this.dataColumn3.ColumnName = "ColumnCalc";
this.dataColumn3.DataType = typeof(int);
this.dataColumn3.Expression = "A+B";
this.dataColumn3.ReadOnly = true;