Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » GridCtrl - how to perform multiselect via CTRL like in ArrayCtrl
GridCtrl - how to perform multiselect via CTRL like in ArrayCtrl [message #27379] Thu, 15 July 2010 11:44 Go to next message
ebiber is currently offline  ebiber
Messages: 2
Registered: July 2010
Location: sarajevo
Junior Member
Hi,
1) How enable multiselect behavior in GridCtrl like in ArrayCtrl? select with Shift works fine, but when press ctrl it not works.
2) how to detect when selection occurs, I try with combination of the WhenChangeRow, WhenChangeCol , WhenCursor and WhenLeftClick but it not works as I expect.
3) is possible to have always selected row when click on it?

I use build nightly 2533 build on windows xp sp3 machine.

and for grid ctrl in layout I select:
ITEM(GridCtrl, transactions, Navigating(true).Searching(true).EnterLikeTab(true).Indicato r(true).HSizePosZ(20, 16).VSizePosZ(76, 28))

other settings are default.

Thanks.
Re: GridCtrl - how to perform multiselect via CTRL like in ArrayCtrl [message #27455 is a reply to message #27379] Sun, 18 July 2010 23:08 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1354
Registered: November 2005
Location: Poland
Senior Contributor

ebiber wrote on Thu, 15 July 2010 05:44

Hi,
1) How enable multiselect behavior in GridCtrl like in ArrayCtrl? select with Shift works fine, but when press ctrl it not works.


grid.MultiSelect();
Quote:


2) how to detect when selection occurs, I try with combination of the WhenChangeRow, WhenChangeCol , WhenCursor and WhenLeftClick but it not works as I expect.


There is no such callback. Could you explain what do you need it for and how it should work?
Quote:


3) is possible to have always selected row when click on it?


Active row is always treated as selected one
Re: GridCtrl - how to perform multiselect via CTRL like in ArrayCtrl [message #27489 is a reply to message #27455] Tue, 20 July 2010 15:45 Go to previous messageGo to next message
ebiber is currently offline  ebiber
Messages: 2
Registered: July 2010
Location: sarajevo
Junior Member
Hi,
1) with grid.MultiSelect() it is possible multiple select, but only sequentially,
for example: let we have a simple grid with ten row named from 1 to the 10.
with multiple select enabled, via shift we can select for example
4,5,6
but cannot be select
2,4,6,8 for example rows. How we can perform selecting those? ArrayCtrl can select those by additionally pressing Ctrl. is possible to add for example Alt + Shift for non continuously multi select.

2) I want to enable/disable some buttons depend on the selection.
3) it has strange behavior. when I ask for selection count it is not selected (count is 0), but when I ask for CurrentRow, it is selected. I solve this by checking current row.

regards,
enis
Re: GridCtrl - how to perform multiselect via CTRL like in ArrayCtrl [message #28818 is a reply to message #27489] Sat, 18 September 2010 00:13 Go to previous message
unodgs is currently offline  unodgs
Messages: 1354
Registered: November 2005
Location: Poland
Senior Contributor

Hi! Sorry for answering so late Smile
ebiber wrote on Tue, 20 July 2010 09:45

Hi,
1) with grid.MultiSelect() it is possible multiple select, but only sequentially,
for example: let we have a simple grid with ten row named from 1 to the 10.
with multiple select enabled, via shift we can select for example
4,5,6
but cannot be select
2,4,6,8 for example rows. How we can perform selecting those? ArrayCtrl can select those by additionally pressing Ctrl. is possible to add for example Alt + Shift for non continuously multi select.


Most likely you selected MultiSelect in layout editor. As it turned out it was not working. It's fixed now in svn. In the meantime you can manually call grid.MultiSelect() in your code.
Multi selecting works in the same way as in ArrayCtrl. One can select a row by holding CTRL and pressing LMB.
Quote:


2) I want to enable/disable some buttons depend on the selection.


Please explain more what are you trying to achieve.
Quote:


3) it has strange behavior. when I ask for selection count it is not selected (count is 0), but when I ask for CurrentRow, it is selected. I solve this by checking current row.


This is correct behavior. The row is select when you select it either with shift or ctrl key (if indicator is visible you can easily see which rows are selected). But there is a method IsSelected() which returns true also if row is not marked as selected but cursor is pointing to it. You can also use FOREACH_SELECTED_ROW to iterate for all selected rows including row with cursor.
Previous Topic: PopUpTable:does this ctrl exist?
Next Topic: GridCtrl Serialize problem and solution
Goto Forum:
  


Current Time: Wed Nov 20 08:08:27 CET 2019

Total time taken to generate the page: 0.01401 seconds