"Sticky" (multiple) selection |
Post Reply |
Author | |
MNovaro
Groupie Joined: 20 June 2006 Status: Offline Points: 71 |
Post Options
Thanks(0)
Posted: 01 December 2008 at 8:54am |
Hello, everybody
I would like to use a Report Control with a "Sticky" selection, that is: selecting multiple items without having to press CTRL (or Shift). In other words: I would like to select a row on click event if it is not selected, and unselect it if it is selected. Is this possible?? Thanks in advance for any help Regards Marco |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Online Points: 1355 |
Post Options
Thanks(0)
|
Set the MultiSelectMode property to True.
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
MNovaro
Groupie Joined: 20 June 2006 Status: Offline Points: 71 |
Post Options
Thanks(0)
|
I guess I have no "MultiSelectMode", since I'm still using the 11.2.1 release....
Is there a way to "simulate" this with code? Thanks again Marco |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Online Points: 1355 |
Post Options
Thanks(0)
|
You could do this:
The only problem being that the focus (dotted rectangle) doesn't move to the most recently clicked row. Unfortunately, all of my attempts to move the focus also reset the selection to a single item. This may or may not be a problem for you though. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Online Points: 1355 |
Post Options
Thanks(0)
|
I just noticed another problem with the above approach - If you click the currently focused row when there are multiple rows selected, the selection will be reset to the just the single focused row. This is because the FocusChanging event doesn't fire (since the focus isn't changing) and we can't cancel the default behaviour. Unfortunately, there is no corresponding SelectionChanging event that would allow us to cancel any selection change. I'll see if I can figure out a workaround.
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
MNovaro
Groupie Joined: 20 June 2006 Status: Offline Points: 71 |
Post Options
Thanks(0)
|
Hello, jbpro
thanks for your help: I can't test your solution in here, but I will do asap and I'll let you know.... |
|
MNovaro
Groupie Joined: 20 June 2006 Status: Offline Points: 71 |
Post Options
Thanks(0)
|
Ehm... I neither have a "FocusChanging" event in my version...
|
|
jpbro
Senior Member Joined: 12 January 2007 Status: Online Points: 1355 |
Post Options
Thanks(0)
|
Hi MNovaro,
Sorry, I didn't know that event wasn't available in 11.2.1. Also, sorry for taking a while to get back, I've been busy with work and a new baby girl! Anyway, I think I have found a solution for you. Assuming you have the MouseDown and MouseUp events, this should work:
If you don't have these events, then the best I can suggest is to buy the upgrade ;) |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
MNovaro
Groupie Joined: 20 June 2006 Status: Offline Points: 71 |
Post Options
Thanks(0)
|
Wow!!
Thanks, jbpro: this actually works as I expected!! Thank you really very much for the help Marco |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Online Points: 1355 |
Post Options
Thanks(0)
|
Glad to help, Marco!
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |