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 wagnerPresenting 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 |.|.|.