Livebindings Expressions for 2 TComboboxes parent to child relationship using ClientDataSets in RAD Studio - delphi

I am trying to connect the parent TCombobox to child TCombobox using the Livebindings in RAD Studio. Meaning, when I select a customer in the parent Tcombobox, the child Tcombobox will generate the jobs under the parent only.
I have tried some binding expressions as you can see in the screenshots below but no avail. I also included below my tables screenshots.
What I want to achieve is to limit the list of jobs with customer-related jobs only. The screenshot below highlighted in blue should be the ones in the dropdown only.
Any help would be greatly appreciated.

I want to conclude this question by answering my own question. I wouldn't get the answer if not for some nice people here willing enough to share quick help. Here's what I got:
I used the ClientDataSet Filtering here. First, I initialized the key field of my clientdatasetJob then set the range of filter by the value selected in the combobox.
cdsJob.IndexFieldNames := 'CustomerName';
cdsJob.SetRange([cmbCustomer.Text],[cmbCustomer.Text]);
You might wonder why same values given in the set range. Basically, I don't need the range but a single value only. I added as well the field CustomerName in the clientdatasetJob for my key field.

Related

access 2010 listbox OLE field

I have a simple query showing serial numbers and a machine type for a simple searchable function within a form. this query also contains an OLE column whih contains customer gathered data from a machine (parameters and alarm histories etc). I want the OLE section to be included within the list box so when the machine is searched for, the searcher will have access to all of the data for that machine.
is there an 'on click' or 'on enter' command for this?
Many thanks in advance
You put the recordID, along with the serial number and machine type in the query for the list box. then when the listbox selection is made, the event can trigger filling in the OLE field on the form - by using the recordID of the selected item.
All that being said - it's a huge guess as to even what you're talking about because you haven't shown us any form or table design or query.

TFS 2015: Order values for <STATE> field

We have a customized TFS Process (template) based on the newest Agile Process and everything is working beautifully, except for the order of the valid-values within the State field (see screenshot).
I've searched high and low and cannot seem to find out any tips on how these values are ordered. I would like to order them in their proper-flow, the same as how the Kanban board orders the Process's set State values.
Any ideas? I've looked within the .xml files for the WIT definitions and the Process flow but nothing is standing out. Thanks for any info!
Image: Customized State values, not exactly order how we'd wish..
No such setting to sort order for State field. It arranges in alphabetical order.

form-only lookup

How can I create a form-only look up in Informix 4GL? I am using form painter plus the informix SE. Any help would be appreciated. I tried to create the form but the field is empty while selecting the choice. I think I am missing the relation or something.
FORMONLY is the equivalent of DISPLAYONLY in isql perform screens. Why not just define the database columns in the attributes section and use the NOUPDATE attribute for each column, or use BEFORE EDITUPDATE OF tabname, ABORT?
Since I4GL doesn't come with a form painter, the only ways to know what you can do with it is by reading the manual for your form painter, or by experimenting.
I'm also not entirely sure what you mean by a FORMONLY lookup? It could be any of a number of items. But the basics are that the field in the form is FORMONLY.fieldname TYPE xyz where xyz is the appropriate type. You use a CONSTRUCT or INPUT to get data into that field; you process the input to do the lookup. INPUT is more appropriate for an exact value lookup; CONSTRUCT will allow more flexible querying.
Since you've not shown what you've tried, nor indicated which form painter you're using, it is going to be hard to help further.
(And I note you've asked this question on the IIUG (International Informix Users Group) mailing list for 'classics' too.)

Multiple Expanding Nodes in Virtual TreeView possible?

I am using a TVirtualStringTree (part of the Virtual TreeView Component) in my Delphi project and I would like to create a view where 2 columns can have children that are expandable/collapsable with [+] sign.
In the picture below as sample I would like to have a [+] sign in the Server Column but also in the Image column. The idea is that the tree has several Server nodes that each have many process child's (which main colum is image) and some processes have sub-processes which are children of the processes'node.
(source: remkoweijnen.nl)
Is such a layout possible? If not with the default component I would appreciate advice on how to implement this in a descendant.
/Edit: The following screenshots are when using the method TOndrej suggests:
alt text http://www.remkoweijnen.nl/temp/TreeView2.png
alt text http://www.remkoweijnen.nl/temp/TreeView3.png
alt text http://www.remkoweijnen.nl/temp/TreeView4.png
OK, I decided to implement as per TOndrej's idea:
alt text http://www.remkoweijnen.nl/temp/TreeView5.png
You most probably don't need that. Just make yourself a clear specification of what grouping you need. The first column can be multi-purpose - showing different information on each grouping level - e.g. level 0: server, level 1: process, level 2 and higher: child process.
On each level, only columns relevant to that level need to display any information. In the above example, level 0 would only display the server name in the first column; the rest of the columns would remain empty.
You could probably implement as many plus signs as you want by custom-drawing but it would be a lot of work and I really think the result is unnecessary, unusual and easily confusing to the user.
Only one column can have the tree, the other columns act a a listview. The column with the tree is the main column.
I would not know how your grouping would work if two columns had a tree and they might "conflict". What is parent node etc etc. GUI technically this might not be the best way of giving those details; a user won't expect it to work that way.

Multiselect listbox bound to database in Delphi 6

I'm using Delphi 6, and I want a database bound list box with multiselect. I found three types of List boxes: TListBox, TDBListBox and TDBLookupListBox.
As far as I can understand, TListbox is not bound to database. TDBListBox and TDBLookupListBox can't be multiselected.
Is there a way to get a multiselect listbox binded to database?
The problem with databinding components is that they rely on a datasource and a datasource has only a single cursor. That is probably the reason why.
By the way, do you need to change the data? Else you could fill a normal listbox from a dataset. Or even use an invisible data listbox and copy the contents to a normal listbox.
Not as far as I know.
The standard is that you offer with the list a bunch of values in which 1 represents the current record.
Unless you have a multivalued field (against best practices) I can't see how you could multiselect...
Or what you might want is actually a sub-table?
DevExpress TcxDBListBox supports multiselect. I use their multiselect drop down check box bound to a database, it's sweet.
The components have methods you can implement to convert to and from your list; EditValueToStates and StatesToEditValue. While the data I store is not normalized (I store a semi-colon delimited list of version numbers), I created a full text search index on the field, with a semi-colon as a delimiter, and now I can still perform optimized searches on that field.
You could create your own custom listbox component that descends from TCustomListBox and add a Datasource property for your list, and another property such as TStrings to be used as a container to hold selected values. You could then post changes to your database using a button click.
If you fiddle with some of the options of a TDBGrid and restrict the columns it displays, you can make something that looks a whole lot like a listbox. Try setting the Options property to [dgTitles,dgTabs,dgRowSelect,dgAlwaysShowSelection,dgCancelOnExit,dgMultiSelect] and work from there.
In a TDbLookupListBox you have the option to bind two different things to data; first you can bind the list to a dataset (ListSource/ListField/KeyField), second you can bind the selected item to a field in another dataset (DataSource, DataField). There is nothing conceptually wrong with wanting to bind the list of items to a dataset, and then manually manage multiple selections, however I don't think it is possible with the current implementation without subclassing and enabling the required control styles.
Based on your comment to François, I would use a normal TListbox and write code to insert all distinct values into the list, and then handle the multi-select values yourself. Jeremy's solution also works, and the DevExpress Express Quantum Grid has a nice filter system which might even save you some other programming.

Resources