adding sub total rows to DataGridView

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,
 

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