Sum of 2 columns in a datagrid

L

LB

Hello everybody, Hopefully I'm the good newsgroup,

On a pocket PC, I'm reading a dataset that is returned by a webservice.
Using a datagrid, I have no problem displaying/hidding some columns for all
rows returned, however, How would I sum the value of 2 columns for each rows
?
Right now, I'm simply associating the datasource to the dataset, and a
tablestyle.

Thank you
 
A

Alex Feinman [MVP]

Add a calculated column to the datatable returned in your dataset

DataTable tbl = myDS.Tables[0];
tbl.Columns.Add("MySum", typeof(double), "Column1+Column2");
 
L

LB

Perfect ! Thank you Alex !

Alex Feinman said:
Add a calculated column to the datatable returned in your dataset

DataTable tbl = myDS.Tables[0];
tbl.Columns.Add("MySum", typeof(double), "Column1+Column2");

LB said:
Hello everybody, Hopefully I'm the good newsgroup,

On a pocket PC, I'm reading a dataset that is returned by a webservice.
Using a datagrid, I have no problem displaying/hidding some columns for
all
rows returned, however, How would I sum the value of 2 columns for each
rows
?
Right now, I'm simply associating the datasource to the dataset, and a
tablestyle.

Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top