Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

make entire Datagridview read-only

I want to display a table from a database in Windows Forms. I want to make it read-only, so one can’t create new rows or modify cells. How can that be achieved?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

A DataGridView has a ReadOnly property that you can set to true. This will make automatically turn off the ability to add rows as well as prevent editing of cell contents. To have a DGV that is modify-only you can set AllowUserToAddRows to false

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading