Skip to content

Adding Custom Column in DataGrid

Taurian 110

Asked Sep 17, 2005, 7:18 PM EDT1 answer
Share
LinkedInX
I need to add a column which will display the total of two fields. I am using a typed dataset, could you please help me with that? THanks.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    In untyped we can use Expression property:
    myDataTable.Columns.Add("newcolumn",typeof(Decimal),"column1+column2");
    In typed DataSet I can't get such field, syntax used below causes an error. May be change something in it:
    <xs:element name="Column" msdata:ReadOnly="true" msdata:Expression="column1+column2" type="xs:string" minOccurs="0" />
    0