I want to show another winform on selection change event.But on load it is showing that form due to default selection of row in data grid view.I have tried clearselection() after binding.
and lots other solution and still stuck in this situation.
my code is given below
Thanks in advance
private void dgvReminder_SelectionChanged(object sender, EventArgs e)
{
// dgvReminder.SelectedRows.Count = -1;
if (dgvReminder.SelectedRows.Count > 0 && cboReport.Text == "Particular BookReport")
{
string cno;
string rno;
cno = dgvReminder.SelectedRows[0].Cells["ChallanNo"].Value.ToString();
rno = dgvReminder.SelectedRows[0].Cells["ReferenceNo"].Value.ToString();
Reports.ParticularBookPreview pbp = new Reports.ParticularBookPreview(cno, rno);
pbp.ShowDialog();
}
}
How to disable datagridview default seleceted row.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Akhil GargRank #772 · 3K reputationPosted Apr 9, 2015, 6:25 PM EDT
Khargesh RajputRank #616 · 3.9K reputationPosted Apr 9, 2015, 7:59 PM EDT