View Single Post
 
Old December 17th, 2008, 08:41 AM
startfarm startfarm is offline
Authorized User
 
Join Date: Mar 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

From what I've read adding rows isn't possible, but I'm open to correction on this. Much easier is to add the data in your query at source so that it's returned with the rest of the results set to bind to the grid view. Look up UNION ALL, but in essence, this example would work:

Select Col1 [Amount], Col2 [Type], Col3 [OtherInfo] From MyTable
UNION ALL
Select Sum(Col1), '-', '-' From MyTable

In a UNION ALL operation, the column names are derived from the first query; these are what your gridview will bind to. The second [and any subsequent] query must contain the same number of columns and each column must be of the same type.