2
Reply

Get next datagridrow

Gilmar Souza

Gilmar Souza

Mar 11 2011 11:26 AM
1.4k
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)