السلام عليكم ورحمة الله وبركاته
PHP كود :
Private Sub DataGridView1_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellValueChanged
Try
DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex + 1).Value = DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value
Catch ex As Exception
End Try
End Sub
أو
PHP كود :
Private Sub DataGridView1_EditingControlShowing(ByVal sender As Object, ByVal e As DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing
If TypeOf e.Control Is System.Windows.Forms.DataGridViewComboBoxEditingControl Then
AddHandler TryCast(e.Control, ComboBox).SelectedIndexChanged, AddressOf ComboBox_SelectedIndexChanged
End If
End Sub
Private Sub ComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells(DataGridView1.CurrentCell.ColumnIndex + 1).Value = TryCast(sender, ComboBox).Text
End Sub
السلام عليكم ورحمة الله وبركاته
