This is about a .NET Windows Forms application written in C#. I have a DataGridView
which is connected to a database. It displays the contents of a selected table.
Now if there are 4 rows in that table, it will display 4 rows. After this I am able to enter the 5th row in the datagrid view. It should be avoided. Now I have to disable creation of a new row. How can I do it?
Simply set the DataGridView.AllowUserToAddRows
property to false
.
Set
dataGrid.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