PC Review


Reply
Thread Tools Rate Thread

DataSet - Novice Question

 
 
=?Utf-8?B?QXNob2s=?=
Guest
Posts: n/a
 
      14th Feb 2004
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
 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      14th Feb 2004
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/de...ta01102002.asp

--
Scott
http://www.OdeToCode.com


On Sat, 14 Feb 2004 03:41:06 -0800, "Ashok" <(E-Mail Removed)>
wrote:

>I am using the datatable to display the details something like this
> Total X Y Z
>GR 200 100 50 50
>CS 100 50 25 25
>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.
>
>TIA
>Ashok


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Novice question Greg Smith Microsoft ASP .NET 2 19th Jul 2006 05:43 PM
Novice question: novice VB editing question smackedass Microsoft Access 2 30th Sep 2004 10:18 PM
novice: dataset and datareader nabil m Microsoft C# .NET 3 10th Sep 2004 02:49 PM
novice : difference bet. dataset and datareader nabil m Microsoft ADO .NET 0 10th Sep 2004 02:05 PM
Novice VBA question... Alex Microsoft Excel Programming 2 22nd Jul 2004 06:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:01 AM.