I have a TDbGrid with some records. I want to drag an drop multiple records to a listbox on simple drag and drop. but after selecting the multiple records when i click on the selected records of grid for dragging, all selected records are become deselect except the current record. How can fix this issue?
Related
I have a Delphi-Firemonkey-Android program. It has a TListBox, named lst1 and a database query. I hooked it up with live bindings like this:
This is what I have in LiveBindings
What I do is select an item in the listbox, then some processing in the Db, and finally close and open the query. Now the list will scroll to the top, but I want to keep the selected item in the listbox.
I know I can get the selected DeliveryId (which is unique per item) in the Listbox by readig:
lfc2fDelivery.BindList.GetSelectedValue.AsVariant
But how do I select the item corresponding the DeliveryId I saved before closing and opening the dataset?
GetSelectedValue is readonly and it wont help relocate the query.
Thanks in advance
I have a TDbGrid linked to a dataset with rows displayed in this grid.
When scrolling on the grid, it moves the selected row of the dataset, which means that if I want to go at the bottom of the grid, it browse every record and the record behind the grid only appears when I am at the bottom of the grid,
The behavior I except is : I want the screen to move but not my record selected ( so the only way to change row would be to click on the row).
Have you got any idea on how to do that?
The behaviour that I except is the same as in the 'Object inspector' of the IDE delphi 10.
This is not possible, the TDBGrid is designed such that it only holds the viewable records in its data buffer. So the selected record must be one in the viewable range. This is to minimize data exchange traffic between the server and the client.
I've noticed that when you have multi-select on in a TDBGrid, have a number of rows selected and delete a record, the record is deleted just fine, but your selection changes below the deleted record. All the rows move up one, but the selection stays in the same location - thus the selection effectively moves down by one record.
Is there an easy way of preserving the selection in a grid when a deletion occurs (or somehow fixing the behavior of the grid)?
i have a grid in which there are various records. On my form i have a Update and Delete button outside the grid. there are different textbox. when i selected a row in a grid its value appear in these textbox from where i can update these value. thats work fine for me. Now i want to delete the selected row?
i dont want to delete a record using delete button in the grid. i want when i select a row and press a delete button then the selected row should delete from grid as well from database.
I guess if you have already done the update part then you can easily delete the selected row. Just call a delete function, instead of the update one, and then call the DataBind() function of the GridView.
When you select multiple nodes of a JvTreeView, and then try to drag these nodes, the JvTreeView selects the node you clicked to drag, rather than initiating dragging all the selected nodes. You end up dragging only this single node.
Is it possible to drag multiple nodes in a JvTreeView? I am using Delphi 2007.
UPDATE: Oddly enough, if I hold down CTRL+SHIFT when dragging the items, I can successfully drag them all. Any ideas?
Suppose MultiSelectStyle is the default [msControlSelect], then the answer to your question is 'you don't release the control key when you're selecting the last item and beginning dragging'.
The culprit is in TJvTreeView.WMLButtonDown in JvComCtrls.pas. Code there tests if 'Ctrl' is pressed when the TreeView is MultiSelect, and clears all items and selects the clicked item if 'Ctrl' is not pressed. It should instead test if the clicked item is already selected and do nothing if it is.
You can see the broken behavior without dragging. Multi select a few items and then click a selected item with the mouse. The VCL TreeView do not select or de-select anything, while the JVTreeView, instead, de-selects all items and selects the clicked one.
Yes absolutely, I do it all the time.
Of course Multi-Select needs to be True and you may need to have a look at the TTreeView's MultiSelectStyle. That controls what type of nodes can be selected at the same time. For example if msSiblingOnly is set to true, you can only select sibblings.
Are you using dmAutomatic or dmManual. If the latter, it could be that you are doing something in the OnMouse* events that is negating the multi-selection you made earlier.