DataGridView1.BeginEdit(True)
but it does not work!
Code:
Private Sub CarregarDataGrid()
Try
DataGridView1.DataSource = Nothing
DataGridView1.AutoGenerateColumns = False
Catch ex As Exception
MsgBox("Erro ao Limpar o DataSource do DataGridView")
Exit Sub
End Try
strsql = "select * from Usuarios"
Dim objCommand As New MySqlCommand(strsql, conn)
Dim dr_temp As MySqlDataReader
Dim bs_temp As BindingSource = New BindingSource
Try
dr_temp = objCommand.ExecuteReader()
bs_temp.DataSource = dr_temp
DataGridView1.DataSource = bs_temp
Catch ex As Exception
MsgBox("Erro")
Exit Sub
End Try
confiDataGrid()
End Sub
Configure DataGrid:
Private Sub confiDataGrid()
If btnManutencao.BackColor = Color.Silver Then
DataGridView1.AutoGenerateColumns = True
With DataGridView1
Try
.Columns(0).HeaderText = "Codigo Usuario"
Catch ex As Exception
MsgBox("Erro")
Exit Sub
End Try
.Columns(1).HeaderText = "Observações"
.Columns(2).HeaderText = "Data Registro"
.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill
End With
End If
End Sub
I'd like to know just how to make it editable by clicking on the cell. Thank you!