2
I’m wanting to return data from a DataGridView
for a DataTimePicker
so that I can change this data and save it again, but I’m having a hard time doing so because the 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
WOW! Thank you so much for answering, look worked yes!! I just changed
frmcadcliente.dtpData.Text
forfrmcadcliente.dtpData.Value
and worked perfectly thank you very much!– Gabriel Arruda
@Gabrielarruda, Dispo!
– Wesley Heron