Not sure how I've managed to avoid this after all of the years of .NET but,....
I have a form with a data grid view on it that I am binding as follows:
Protected dsRooms As New DataSet
Protected dvRooms As New DataView
Private Sub frmRoomEdit_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
daRooms.Fill(dsRooms, ROOMS)
'-- allow for update, new, delete.
Dim commandbuilder As New SqlCommandBuilder(daRooms)
dvRooms = dsRooms.Tables(ROOMS).DefaultView
dvRooms.Sort = "Room ASC"
dgvRooms.DataSource = dvRooms
Catch ex As Exception
MsgBox("Error Loading Room List: " & ex.Message)
End Try
End Sub
When I added the dgv to the form I unchecked the options to ADD and DELETE rows.
Now, I am interested in inhibiting the editing of the pk field column.
Is this possible and how to proceed?
TIA - Gary in Massena.
Gary in Massena
Gary in Massena