I have binded a datagridview to a datatable. But the gridview displays an extra empty row at the bottom ? How should I hide it ? Thanks in Advance
There are two ways to remove the Remove (Delete) Last Blank (Empty) Row from DataGridView. The first way is to right click the DataGridView and then click Properties item from the Context menu. Now from the Properties window, look for AllowUserToAddRows property and set it False.
Rows. Remove() method, and binding using a BindingSource rather than binding the List directly as the data source. I found a few references to this occurance via Google, but answers were either not forthcoming or said to use a Delete() method on either the DataGridView or the DataGridView.
The DataGridView control provides a powerful and flexible way to display data in a tabular format. You can use the DataGridView control to show read-only views of a small amount of data, or you can scale it to show editable views of very large sets of data.
The extra row is to manually add a line to your datagridview. If you don't need it you can disable it by disallowing the user to add rows:
this.dataGridView.AllowUserToAddRows = false;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With