I have a DataGridView that I am using as a universial grid for several tables. In it's implementation in the form load event I use the following code:
If Not myTableName = "" Then Me.Text = Me.myTableName & " Editor" Dim strSQL As String = "SELECT * FROM " & myTableName & ";"
myDataAdapter = GetDataAdapter(strSQL)
myDataAdapter.Fill(myDataTable)
dgView1.DataSource =
New DataView(myDataTable)dgView1.AllowUserToDeleteRows =
True End IfPublic Function GetDataAdapter(ByVal strSQL As String) As Common.DbDataAdapter Dim strConn As String = _ Global.BHRmain.My.MySettings.Default.BHRdataViaExpress Dim connection As SqlClient.SqlConnection = New SqlClient.SqlConnection(strConn) Dim adapter As Common.DbDataAdapter = New SqlClient.SqlDataAdapter(strSQL, connection) Dim comBuilder As SqlClient.SqlCommandBuilder = New SqlClient.SqlCommandBuilder(adapter) Return adapter End Function
In the help system it says that for me to be able to delete a row from the grid, I need to set "IBindingList.AllowRemove". I haven't a clue as to what this means. I cannot find this reference anywhere in the objects I have.
Is there somewhere I can tell this thing that it is OK to delete a row.
Thanks, Rich