View previous topic :: View next topic |
Author |
Message |
rnemchev
Joined: 26 Apr 2010 Posts: 12
|
Posted: Fri Apr 30, 2010 3:22 pm Post subject: Custom selection |
|
|
Hi,
I like multiple selection very much but in my case with about 1000000 items in the tree I get OutOfMemoryException (because the internal list with selected items becomes huge) when click on the first item, scroll to the last and click with Shift key pressed. Is there a way to customize the selection mechanism? I have an idea to keep selection as ranges where it is possible instead of separate items.
Thank you in advance!
Rado |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Apr 30, 2010 11:43 pm Post subject: |
|
|
You can handle the SelectionChanging event and calculate the size of the selection from:
Code: | int selectionSize = Math.Abs(e.StartRow.RowIndex - e.EndRow.RowIndex); |
Then if the selection is too large you can set e.Cancel (or give the user an opportunity to decide if they want to proceed with the selection). _________________ Infralution Support |
|
Back to top |
|
|
rnemchev
Joined: 26 Apr 2010 Posts: 12
|
Posted: Sat May 01, 2010 9:56 am Post subject: |
|
|
Thank you! This is a good advice. |
|
Back to top |
|
|
|