I want to return data from a DataGridView
to a DataTimePicker
so I can change this data and save it again, but I'm having a hard time doing this because DataTimePicker
does not accept value type.
private void btnAlterar_Click(object sender, EventArgs e)
{
FrmCadCliente frmcadcliente = new FrmCadCliente();
frmcadcliente.Show();
frmcadcliente.txtID.Text = pacientes_TCCDataGridView.SelectedRows[0].Cells[0].Value.ToString();
frmcadcliente.txtNome.Text = pacientes_TCCDataGridView.SelectedRows[0].Cells[1].Value.ToString();
frmcadcliente.txtCPF.Text = pacientes_TCCDataGridView.SelectedRows[0].Cells[2].Value.ToString();
frmcadcliente.txtRG.Text = pacientes_TCCDataGridView.SelectedRows[0].Cells[3].Value.ToString();
frmcadcliente.cbxSexo.Text = pacientes_TCCDataGridView.SelectedRows[0].Cells[4].Value.ToString();
frmcadcliente.dtpData.Text = pacientes_TCCDataGridView.SelectedRows[0].Cells[5].Value.ToString();
}
The error happens on this last line in Value