datagridview アイテム (datetime 形式) を文字列に変換する方法。
これは私のコードです:
ComboBox1.Text = DatagridView1.Item(4, 1).Value.ToString()
誰かが私を助けることができますか?これは完全なコードです:
Private Sub DataGridView1_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
btnEdit.Visible = True
Dim i As Integer
i = DataGridView1.CurrentRow.Index
Dim x As String = CStr(DataGridView1.Item(4, i).Value.ToString)
Dim y As String = CStr(DataGridView1.Item(5, i).Value.ToString)
MsgBox(x)
MsgBox(y)
txtTrainID.Text = DataGridView1.Item(0, i).Value
txtRouteID.Text = DataGridView1.Item(1, i).Value
txtLine.Text = DataGridView1.Item(2, i).Value
cmbLine1.Text = DataGridView1.Item(3, i).Value
cmbLine2.Text = DataGridView1.Item(3, i).Value
cmbLine3.Text = DataGridView1.Item(3, i).Value
cmbTS.Text = x.ToString
cmbTA.Text = y.ToString
txtTrainName.Text = DataGridView1.Item(6, i).Value
cmbFlag.Text = DataGridView1.Item(7, i).Value
End Sub