Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide the extra row at the bottom in a DataGridview in a Winform Application

Tags:

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

like image 665
Ananth Avatar asked Nov 18 '10 07:11

Ananth


People also ask

How to remove extra row in DataGridView in c#?

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.

How to remove last row from GridView in asp net c#?

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.

What is DataGridView control?

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.


1 Answers

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; 
like image 162
Jla Avatar answered Oct 06 '22 00:10

Jla