2
Answers

Get next datagridrow

Gilmar Souza

Gilmar Souza

13y
1.5k
1
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)