DataGrid Multiple Selection

  • Thread starter Thread starter Ahmet AKGUN
  • Start date Start date
A

Ahmet AKGUN

Hi;

How can we get multiple selections on a datagrid ?
There is one property called CurrentRowIndex but it always retrieves last
selection.
On grid I have lots of selections, all selected using Ctrl key and I need
all of them.

Any way to get all selections ?

Thanks...
 
Hello Akhmet,

Yes, there is a way. The DataGrid has IsSelected method enabling you to
query any row whether it is selected. This, however, could kill the
performance should you have thousands or rows and each of them has to be
probed. Unfortunately, there is no kind of "SelectedRows" collection
available. Hope this will be changed in the next version of the .NET
Framework.
 
IsSelected will work for now,
Thansk Dmitriy.

Dmitriy Lapshin said:
Hello Akhmet,

Yes, there is a way. The DataGrid has IsSelected method enabling you to
query any row whether it is selected. This, however, could kill the
performance should you have thousands or rows and each of them has to be
probed. Unfortunately, there is no kind of "SelectedRows" collection
available. Hope this will be changed in the next version of the .NET
Framework.

--
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

Ahmet AKGUN said:
Hi;

How can we get multiple selections on a datagrid ?
There is one property called CurrentRowIndex but it always retrieves last
selection.
On grid I have lots of selections, all selected using Ctrl key and I need
all of them.

Any way to get all selections ?

Thanks...
 
Back
Top