コンボボックス付きのデータグリッドがあります。ここで、onが列0の行0の値xを選択した場合、列1の行0のコンボボックスの値yがxと同じ値に自動的に設定されることを実現したいと思います。
私は試した
Private Sub dataGridView1_CellValidating(ByVal sender As Object, ByVal e As DataGridViewCellValidatingEventArgs) Handles Sched_Grid.CellValidating
If Sched_Grid.CurrentCell.ColumnIndex = 0 Then
Sched_Grid(1, Sched_Grid.CurrentCell.RowIndex).Value = Sched_Grid(0, Sched_Grid.CurrentCell.RowIndex).Value
End If
End Sub
ただし、すぐには機能しません。最初に値x(0,0)を選択し、次に別のセル(5,5など)をクリックしてから、x(0,0)セルに戻ってクリックし、y(1,0)がに設定されるようにする必要があります。 x(0,0)。
これはどのように解決できますか?