DataGridView not displaying subtotals

  • Thread starter Thread starter Parrot
  • Start date Start date
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
 
Dave,

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

Regards,
Jibesh
 
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
 
Back
Top