DataSet - Novice Question

G

Guest

I am using the datatable to display the details something like thi
Total X Y
GR 200 100 50 50
CS 100 50 25 2
FG% (cs/GR) 150% 50% 50% 50%

In the above table I am calculating the FG% while creating the row. In the end I use the table.Column.add("total") to get the totals for all the rows. But while the rows 1 and rows 2 totals are fine, you cannot add the % row in the same manner. I am virtually at my wits end as how to get the correct % in the totals column

TI
Ashok
 
S

Scott Allen

Two alternatives.

First, to add the new row, use

DataRow workRow = workTable.NewRow();

I'm assuming your columns are all of int type, so you won't be able to
just stick a % sign in the row. So an alternate technique (or perhaps
you need to combine the two) would be to handle the ItemCreated event.
Here is a good article on the subject:

Summary Rows in DataGrid Controls
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndive/html/data01102002.asp
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top