adding sub total rows to DataGridView

  • Thread starter Thread starter Steve Richter
  • Start date Start date
S

Steve Richter

I wanted to add sub total rows to a DataGridView by using a RowsAdded event
handler to add the subtotal rows to the Rows collection of the grid as it is
being built.

problem is I get an exception ... "Rows cannot be programmatically added to
the DataGridView's rows collection when the control is data-bound. ..." in
the RowsAdded event handler on the "DataGridView1.Rows.Add(1)" statement.

Is there a way to get around this exception?

What is the recommended way of adding subtotal rows to a DataGridView?

thanks,
 
Back
Top