0
지금이 작업을 시도해 보았습니다. 데이터 그리드보기에서 정보를 두 번 클릭하여 녹음 된 데이터를 업데이트하려는 경우, "입력 문자열이 올바른 형식 "오류. 내 코드 :입력 문자열의 형식이 올바르지 않습니다.
private void dgvGroundtech_Double Click(object sender, EventArgs e){
if(dgvGroundtech.CurrentRow.Index != -1)
{
Id = Convert.ToInt32(dgvGroundtech.CurrentRow.Cells[0].ToString());
txtName.Text = dgvGroundtech.CurrentRow.Cells[1].ToStrings();
txtItem.Text = dgvGroundtech.CurrentRow.Cells[2].ToStrings();
txtMobileNumber.Text = dgvGroundtech.CurrentRow.Cells[3].ToStrings();
cmbPurpose.Text = dgvGroundtech.CurrentRow.Cells[4].ToStrings();
txtAddress.Text = dgvGroundtech.CurrentRow.Cells[5].ToStrings();
txtAmount.Text = dgvGroundtech.CurrentRow.Cells[6].ToStrings();
txtDate.Text = dgvGroundtech.CurrentRow.Cells[7].ToStrings();
}
}
아마도'dgvGroundtech.CurrentRow.Cells [0] .ToString()'은 정수로 변환 될 수있는 것이 아니며 그 값은 무엇입니까? 전체 스택 추적은 무엇입니까? –
dgvGroundtech.CurrentRow.Cells [0]의 값은 무엇이며 ToStrings() 메서드의 기능은 무엇입니까? – jhen
값은 0, int Id = 0입니다. – Pils