Discussion:
Grid Select via programing
(too old to reply)
wagner
2008-10-31 19:59:32 UTC
Permalink
Presenting the records from a table in a grid, how do I select multiple rows of the grid via programming, without using the intervention of the user who must use the mouse and click CTR + onLefMouseClick
Geoff Wass [dBVIPS]
2008-11-01 06:17:07 UTC
Permalink
Post by wagner
Presenting the records from a table in a grid, how do I select multiple rows of the grid via programming, without using the intervention of the user who must use the mouse and click CTR + onLefMouseClick
Wagner,

In the dUFLP there is a GridStuff.prg you should be able to adapt to
your purpose. It does a "select all" for the grid. You would have to
change it a bit to select specific rows.
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada

.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
.|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
wagner
2008-11-01 14:35:16 UTC
Permalink
Geoof,

When you move the pointer from the table loses the selection made.
I used the following algorithm.

aSelecionados = form.grid1.selected()

// only to clear the selections.
for x = 1 to aSelecionados.size
form.movimento.rowset.goto( aSelecionados[x] )
next

for x = 1 to aSelecionados.size
tmp=keymap.getbyte(vk_shift)
keymap.setbyte(vk_shift,128)
setkeyboardstate(keymap)
// grid-reference passed as parameter, i.e. form.grid1
sendmessage(this.hwnd,wm_lbuttondown,mk_shift,0x0E0018)
keymap.setbyte(vk_shift,tmp)
setkeyboardstate(keymap)
form.movimento.rowset.goto( aSelecionados[x] )
next

If I can help I will be grateful.
Post by Geoff Wass [dBVIPS]
Post by wagner
Presenting the records from a table in a grid, how do I select multiple rows of the grid via programming, without using the intervention of the user who must use the mouse and click CTR + onLefMouseClick
Wagner,
In the dUFLP there is a GridStuff.prg you should be able to adapt to
your purpose. It does a "select all" for the grid. You would have to
change it a bit to select specific rows.
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada
.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
.|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
Geoff Wass [dBVIPS]
2008-11-02 06:02:06 UTC
Permalink
This post might be inappropriate. Click to display it.
Geoff Wass [dBVIPS]
2008-11-02 06:51:37 UTC
Permalink
Wagner,

I tried my hand at it, but I'm not as good at this stuff as someone like
Marc. My idea does not look feasible. However, looking at your example,
I get the feeling you may not need to do this. You seem to have an array
of bookmarks of selected items. Was this just for your example here or
is that what you have already? If this is what you have already, then
what you could do is preserve the GRID with the user's selection(s) and
do your processing somewhere else (or with the GRID's
ROWSET.notifyControls=false). Thus, you would never have to reset the
GRID.
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada

.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
.|.|.| IT Consultant http://Geoff_Wass.com |.|.|.
Marc VdB
2008-11-03 12:19:12 UTC
Permalink
Hi Wagner,
Post by wagner
When you move the pointer from the table loses the selection made.
I used the following algorithm.
do you have a short form, together with the table, to show what you are
trying to do ?

If so, i think it should be possible to make it work...

CU, Marc

Loading...