Gilmar Souza

Gilmar Souza

  • NA
  • 1
  • 1.7k

Get next datagridrow

Mar 11 2011 11:26 AM
How Can I get a next row in the datagridview?

This my code

private void button1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < dataGridView1.Rows.Count; i++)
            {

                //Data gridview to listview
                listView1.Items.Add("" +dataGridView1.CurrentRow.Cells[0].Value.ToString());

                //
                dataGridView1.Rows[dataGridView1.CurrentRow.Index+i].Selected=false;

            }
        }

It's works but... It's don't gets a last data row

Answers (2)