selecting multiple rows in a datagrid programatically

J

jack charbonneau

Hi

I need to select multiple rows in a DataGrid in my
program.

I do this:

dataGrid1.Select(rowNumber);

which works fine if I only want one row selected, but
sometimes I need more than one. How do I do this?

thanks
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hi Jack,

Just repeat the process for each of the rows. I know this is inefficient,
but there seems to be no other way.
 
J

jack

Man do I feel stupid! There was code in the mouse click
handler which was deselecting all items before selecting
the new one, so I thought that Select() was doing the
deselecting. Oops! and thanks
-----Original Message-----
Hi Jack,

Just repeat the process for each of the rows. I know this is inefficient,
but there seems to be no other way.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

jack charbonneau said:
Hi

I need to select multiple rows in a DataGrid in my
program.

I do this:

dataGrid1.Select(rowNumber);

which works fine if I only want one row selected, but
sometimes I need more than one. How do I do this?

thanks

.
 

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