How to Make a DataGridView Row Not Selectable in C Sharp
A "DataGridViewRow" represents a row of data in a .NET DataGridView control. In Visual Studio you can set the row to read-only which means the user cannot select or edit the data or the row's properties. Visual Studio includes a designer where you can edit the read-only property for the row without typing any code to lock the row.
Instructions
-
-
1
Open the Visual Studio software from the Windows "Start" menu's ".NET Framework" program group. Open your Web project that contains the DataGridView you want to edit.
-
2
Double-click the form that contains the DataGridView. Hover your mouse over the DataGridView row and click the arrow that displays. Click "Edit Columns" to open a configuration window.
-
-
3
Click the first column name and click "True" in the "ReadOnly" property. Repeat this step for each column in the configuration window. This property sets the entire row as "Read Only" for the user.
-
4
Click the "Save" button to save the changes, then click "Run" to review the code changes in your default .NET browser.
-
1