3
Reply

Index was out of range. Must be non-negative and less than t

Jitendra Shekhawat

Jitendra Shekhawat

Jan 18 2017 3:23 AM
158
ID = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());
TitalcomboBox.Text = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
NametxtBox.Text = dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();
HPtxtBox.Text = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
//CPtxtBox.Text = dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString();
//WPtxtBox.Text = dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString();
//AddrstxtBox.Text = dataGridView1.Rows[e.RowIndex].Cells[6].Value.ToString();
//CitytxtBox.Text = dataGridView1.Rows[e.RowIndex].Cells[7].Value.ToString();
//StatecomboBox.Text = dataGridView1.Rows[e.RowIndex].Cells[8].Value.ToString();
//PintxtBox.Text = dataGridView1.Rows[e.RowIndex].Cells[9].Value.ToString();
//PEmailtxtBox.Text = dataGridView1.Rows[e.RowIndex].Cells[10].Value.ToString();
//WEmailtxtBox.Text = dataGridView1.Rows[e.RowIndex].Cells[11].Value.ToString();
//GendrcomboBox.Text = dataGridView1.Rows[e.RowIndex].Cells[12].Value.ToString();
//dateTimePicker1.Text = dataGridView1.Rows[e.RowIndex].Cells[13].Value.ToString();
//dateTimePicker2.Text = dataGridView1.Rows[e.RowIndex].Cells[14].Value.ToString();

Answers (3)