Cell content double click not working Properly?

Apr 29 2020 2:11 AM
I have three datagridview in one form.In all three datagridview, i have a cell content double click event.But Unfortunetly two cell Content double click work correct but third one is not working correctly?How can i solve these problem?
Gridview One:
private void dgvAsk_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0)
{
//gets a collection that contains all the rows
DataGridViewRow row = this.dgvAsk.Rows[e.RowIndex];
//populate the textbox from specific value of the coordinates of column and row.
txtId.Text = row.Cells[0].Value.ToString();
txtQuestion.Text = row.Cells[1].Value.ToString();
cmbValueType.Text = row.Cells[2].Value.ToString();
chkIsrequired.Checked = row.Cells[3].Value.ToString()=="1"?true:false;
ntxtSeq.Text = row.Cells[4].Value.ToString();
txtPholder.Text = row.Cells[5].Value.ToString();
txtMinVal.Text= row.Cells[6].Value.ToString();
txtMaxVal.Text= row.Cells[7].Value.ToString();
txtMinLen.Text= row.Cells[8].Value.ToString();
txtMaxLen.Text= row.Cells[9].Value.ToString();
txtPattern.Text= row.Cells[10].Value.ToString();
cmbOptName.Text= row.Cells[11].Value.ToString();
cmbConName.Text= row.Cells[12].Value.ToString();
chkSeqValidate.Checked= row.Cells[13].Value.ToString()=="1"?true:false;
ntxtInd.Text= row.Cells[14].Value.ToString();
txtUrduText.Text = row.Cells[15].Value.ToString();
}
}
Gridview Two:
private void dgvAskCond_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0)
{
//gets a collection that contains all the rows
DataGridViewRow row = this.dgvAskCond.Rows[e.RowIndex];
//populate the textbox from specific value of the coordinates of column and row.
txtConID.Text = row.Cells[0].Value.ToString();
txtCondtionName.Text = row.Cells[1].Value.ToString();
cmbQuestions.Text = row.Cells[2].Value.ToString();
txtAnswer.Text = row.Cells[3].Value.ToString();
}
}
Gridview Three:
private void dgvAskOption_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0)
{
//gets a collection that contains all the rows
DataGridViewRow row = this.dgvAskOption.Rows[e.RowIndex];
//populate the textbox from specific value of the coordinates of column and row.
txtOptID.Text = row.Cells[0].Value.ToString();
txtCode.Text = row.Cells[1].Value.ToString();
txtTitle.Text = row.Cells[2].Value.ToString();
txtOptName.Text = row.Cells[3].Value.ToString();
}
}

Answers (4)