I need to present the user with a matrix of which one column is editable. What is the most appropriate control to use?
I can't use a ListView because you can only edit the first column (the label) and that's no good to me.
Is the DataGridView the way to go, or are there third party alternative components that do a better job?
The DataGrid control supports cell and row editing functionality. By default, you can edit items directly in the DataGrid. The user can enter edit mode in a cell by pressing F2 key or double tapping on a cell. Alternatively, you can set the DataGridColumn.
You could modify each cell within the column as read only where the cell value is not equal to null or String. Empty. This will allow the user to edit those cells that are blank and protect your data. Show activity on this post.
By default, users can edit the contents of the current DataGridView text box cell by typing in it or pressing F2. This puts the cell in edit mode if all of the following conditions are met: The underlying data source supports editing.
Making a column editable This lets the user edit any cell from the specified column. By default, only one cell at a time can have its editMode prop set to "edit" . To let your users edit all cells in a given row simultaneously, set the editMode prop to "row" . For more information, see the section on row editing.
DataGridView is the best choice as it is free and comes with .NET WinForms 2.0. You can define editable columns or read-only. Plus you can customize the appearance if required.
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