all groups > dotnet windows forms > september 2003 >
You're in the

dotnet windows forms

group:

selecting multiple rows in a datagrid programatically


selecting multiple rows in a datagrid programatically jack charbonneau
9/25/2003 11:55:51 PM
dotnet windows forms:
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
Re: selecting multiple rows in a datagrid programatically Dmitriy Lapshin [C# / .NET MVP]
9/26/2003 1:35:21 PM
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

[quoted text, click to view]
Re: selecting multiple rows in a datagrid programatically jack
9/26/2003 1:41:19 PM
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

[quoted text, click to view]
AddThis Social Bookmark Button