Programmatically selecting a row inside of a DataGridView

G

Guest

I'm creating a C# (.NET BETA2) Windows application (NOT a Web application, a
Windows application), and I would like to programmatically selecting a row
inside of a DataGridView. It seems like it should be pretty easy to do, but
I'm have a hard time with this.

Can anyone give me any guidance?

Thanks,

David
 
G

Guest

It seems like you need to get the DataGridViewRow object, and set the
selected property to true in order to select the row. For example,

//assume there is a DataGridView object called dataGridView1
//and you wanna select the first row programmatically

dataGridView1.Rows[0].Selected = true;

Hope it helps
Ivan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top