Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I Select Multiple rows in a grid?
Message
From
17/11/1999 16:09:52
 
 
To
17/11/1999 14:42:10
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00292071
Message ID:
00292109
Views:
21
>Hi all,
>
>I need to know if there is a way to design a grid so that a user can select multiple rows in a grid by using a hot key and the down or up arrow? Or, something to this effect.
>
>Thank You

To "select" multiple rows in a grid, you need an additional field in the underlying table that denotes whether the current record is selected.

You can create the visual effect of record selection by setting your grid column's DynamicBackColor properties to something like:

IIF(MyTable.Selected,RGB(255,0,0),RGB(255,255,255))

To enable the user to toggle the selection status with hotkeys, you'll have to write code in the Keypress events of the textboxes in the grid to watch for the selected keys, and take the appropriate action. You could try something like:
DO CASE
	CASE nKeyCode = 24 AND ShiftAltCtrl = 1 && Shift Down-arrow
		NODEFAULT
		lSelected = Mytable.Selected
		SKIP
		REPLACE Mytable.Selected WITH lSelected
		
	CASE nKeyCode = 5 AND ShiftAltCtrl = 1 && Shift up-arrow
		NODEFAULT
		lSelected = Mytable.Selected
		SKIP -1
		REPLACE Mytable.Selected WITH lSelected
ENDCASE
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform