selecting multiple rows in a datagrid programatically

  • Thread starter Thread starter jack charbonneau
  • Start date Start date
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
 
Hi Jack,

Just repeat the process for each of the rows. I know this is inefficient,
but there seems to be no other way.
 
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

.
 
Back
Top