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
Related
I have a grid with a CheckColumn connected through livebindings with a query. When i open my query all my data is loaded into grid, but the checkbox do not show. If i click on the grid then the checkbox appears.
Picture when i open my query:
When i click on the grid:
I discovered that using gridItens.Content.Repaint Redraw the checkboxes, for now I'll keep it that way, but I'll take a look at this component #Alberto Miola!
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 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?
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.
I have Delphi 7 and I'm using NexusDB for the database.
I have a main form where I have a DBLookupComboBox to list the contents of a Table.
If I press a button I have on the form to add a new item to the list (which opens a 2nd dialog box) and then come back to the main form I want the newly added item to show up immediately
I can't seem to get that to work.
I've tried refreshing the DataSet under the ListSource object.
Anyone have any ideas?
Thanks,
David
DBLookupComboBox1.ListSource.DataSet.Close;
DBLookupComboBox1.ListSource.DataSet.Open;