How to make columns in datagridview non-editable or editable
-
Wednesday, June 01, 2011 3:24 AM
Dear all,
How to make some columns in datagridview editable and some columns are non-editable in the same datagridview control??
All Replies
-
Wednesday, June 01, 2011 4:38 AM
Raymond,
You can do that in the designer, rightclick on the datagridview, select the column and set it to ReadOnly = true
It results in this code in the designer.vb
' 'Column1 ' Me.Column1.HeaderText = "Column1" Me.Column1.Name = "Column1" Me.Column1.ReadOnly = True '
Success
Cor- Proposed As Answer by Kee PoppyModerator Thursday, June 02, 2011 8:56 AM
- Marked As Answer by Kee PoppyModerator Wednesday, June 08, 2011 6:11 AM
-
Wednesday, June 01, 2011 6:13 AM
You can do that by setting the column(s) that you want to be non-editable, as readonly
E.g
DGView.Columns("ColumnName").ReadOnly = True
Regards Pranabjyoti- Proposed As Answer by Kee PoppyModerator Thursday, June 02, 2011 8:56 AM
- Marked As Answer by Kee PoppyModerator Wednesday, June 08, 2011 6:11 AM

