Is this possible in DataGridView?

  • Thread starter Thread starter B. Chernick
  • Start date Start date
B

B. Chernick

I have a Winforms app (Dot Net 2.0) with a datagridview bound to a table. I
am supposed to be able to add, edit, and delete rows. One particular column
is to be read-only for existing records. Both the program and the data
structure are works in progress.

It appears that what I need to do is to make the cell of that read-only
column editable for record adds only. Is this possible?
 
Never mind. Found it (I think).

Private Sub dgvParts_RowEnter(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvParts.RowEnter
If dgvParts.Rows(e.RowIndex).IsNewRow Then
dgvParts.Rows(e.RowIndex).Cells(0).ReadOnly = False
End If
End Sub
 
Back
Top