3

I have a datatable which I use it as a datasource for my datagridview:

dgv.DataSource = dt;

but after binding the datatable I get the below result. The last row allows people to click on the row and enter data which I don't want to happen.

How can I remove the last row in run time (highlighted in the picture)enter image description here

Thanks

Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939
03Usr
  • 3,335
  • 6
  • 37
  • 63
  • possible duplicate of [DataTable, How to conditionally delete rows](http://stackoverflow.com/questions/1591771/datatable-how-to-conditionally-delete-rows) – Ramesh Rajendran Dec 03 '13 at 11:00
  • This is not about how to delete datatable row, it is about removing the footer. – 03Usr Dec 03 '13 at 11:27

1 Answers1

7

That is not data table row but so called NewRow of DataGridView to remove it set property AllowUserToAddRows (MSDN) to false for your gird.

You may either set it from code or using visual studio designer.

gzaxx
  • 17,312
  • 2
  • 36
  • 54