Mohammadali

Mohammadali

  • NA
  • 44
  • 107.1k

how to go next row in datagridview

Nov 18 2011 11:42 AM
hello

i use this method for go next row in datagridview
 private void btnNext_Click(object sender, EventArgs e)
        {
            if (grdQustion.Rows.Count >= 1)
            {
                int i = grdQustion.CurrentRow.Index + 1;
                if (i >= -1 && i < grdQustion.Rows.Count)
                    grdQustion.Rows[i].Selected = true;

            }
        }
But I've written some code in grdQustion_RowEnter .When I go to the next row of code above the code will not run into grdQustion_RowEnter
Even CurrentRow. Index does not change


how can i go next row in datagridview with button??

Answers (4)