TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Khurram Naqshbandi
NA
58
4.8k
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();
}
}
Reply
Answers (
4
)
Xamarin - Android Connect to SQL Server via WIFI
How to use a dll encoded in delphi from C# in Visual Studio