Lorenz
Lorenz

Reputation: 38

Stop DataGridView from autoadding a new row

Hey guys, sorry for this probably fairly simple question but I'm starting to get crazy about this^^ Point is I show a little data to the user via an DataGridView, its not bound to a datasource but added directly. Now so far everything works fine but the dgv always automatically adds a new, empty line after the ones I added. I've tried removing it by rows.remove(), etc but I just got errors...

Maybe one of you knows the answer?

Thanks for any help in advance!!!

Greets,

Lorenz

Upvotes: 2

Views: 2585

Answers (1)

Akram Shahda
Akram Shahda

Reputation: 14781

Set the DataGridView.AllowUserToAddRows property value to false to hide the new row. Set it back to true to show the new row again.

Upvotes: 5

Related Questions