DataGrid or Flexgrid for Multiple Selections?
Which control do I use? I use an ADO Control to fill the
Datagrid/Flexgrid with database information. After that is done, I
want to give the user the ability to select multiple records. BUT,
after the user selects the multiple records, I want the ability to use
a field ("recordid") in each of the records to UPDATE the database. I
have tried using both of these controls, and I can get it to select
multiple selections, but I can not retrieve a field within each
record.
Which control do I use, Datagrid or Flexgrid? Then, how can I allow
the user to select multiple records and then UPDATE the database
according to the records chosen (using one field within each record)
I hope I can get some help with this. So far, I have been getting the
overall answer that it can not be done.
Thanks for any help,
Reaper
Just learned something...
Reaper,
You can try this
Quote:
Thanks to geoff_xrx
VB Code:
Private Sub MSFlexGrid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 2 Then
MSFlexGrid1.Row = MSFlexGrid1.MouseRow
End If
End Sub
Returns the mouse position in row, col coordinates
Multiple Selection problem
OK, the additional info you sent helped alot.
Your code is fine. The problem lies in the size of the grid. As you recall, we had to make the grid invisible when selecting the row to prevent seeing the cells highlight. What's happening is the user is moving the mouse faster than the grid can keep up with everything. About the best thing I can think of off hand is abandoning the drag method of selecting and use a Shift-Click method instead.
To select rows 3 to 7, the user clicks on row 3 and shift-clicks on row 7. Programmatically you select rows 3 to 7. You could extend this to ctrl-click to deselect a row. You will need a couple of variables to keep track of what rows were clicked and shift-clicked, and just loop from one to the other highlighting them.