DataGridView not displaying subtotals

P

Parrot

I am using the following SQL query to populate a dataGridView control.

SELECT DEPT, Employee, Curr_$ FROM EE
ORDER BY DEPT, Employee
COMPUTE SUM(EARNDED.Curr_$) BY DEPT

OleDbDataAdapter dataAdapter = new OleDbDataAdapter(SQLCommand, strConn);
table = new DataTable();
int ret = dataAdapter.Fill(table);
dataGridView1.DataSource = table;

The above query only returns records for the first control break or DEPT and
does not give any subtotals. I do get correct results if I submit the same
query in Enterprise Manager. Does anyone know why I can't get subtotals to
display for all depts in my dataGridView?
Dave
 
N

Newsgroup

Dave,

can you check the "AutoGenerateColumns " property set to true or you have
added enough columns to accommodate the selected fields ?

Regards,
Jibesh
 
P

Parrot

I do not set AutoGenerate columns since I am creating a dynamic query each
time with different columns. All the columns are displayed but the rows stop
at the end of the first control break (DEPT) in this example and the
subtotals for the first control do not show. It almost seems like a
limitation in the dataGridView control. I check for the number or rows
returned from my fill command and it shows the number that are displayed on
the datagridview. It is a mystery to me why the remaining rows are not
showing.
Dave
 

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