priyanka bhatnagar

priyanka bhatnagar

  • 1.6k
  • 48
  • 9.7k

How to disable datagridview default seleceted row.

Apr 3 2015 12:50 AM
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();
            }
        }



Answers (2)