This article was brought to you by the guys from VDF-GUIdance.
For more DataFlex targeted articles see


by David Martinko


Size: 7 KB Download
Date Created: 21/11/2002
Date Updated: 21/11/2002
Author: David Martinko
Company: Redeemed Software


VDF7 or higher required


The cdbForm_dsflist class which is short for "databound form with a dynamic sizing floating list", can be regarded as an IDE-compatible AUTOCOMPLETE solution.
This class is used to help aide in data entry. As you type, a list is shown with possible matches to what you are typing. If you see what you want in the list, you press ENTER to select the text to complete what you started typing


After placing the object on your view, select the file.field you wish to data to be connected to. You may choose a separate file.field for data to be displayed from by setting the Alt_Data_File and Alt_Data_Field. You must set the Float_Index to the index you wish the searching to be performed on. This index needs to be a unique index for the data being displayed otherwise you will have the data repeated many times.

I don't recommend you use this on a field for a last name because you when the user types "SMITH", all they will see is a list containing only "SMITH" and will never see "SMITHERS" until they type the "E".

If the data is coming from the same file (i.e. you didn't set the Alt_Data_File) then you can set the Float_Find to TRUE. This option will allow the record you just selected to become the current record. This action is simular to that of the selectionlist class, just a bit faster for data entry. Let's say you want to use the Float_Find in an Invoice# field. You want to help the user by showing all possible invoices matching what they entered. In this case, it would help to show the find results in descending order. This can be done by setting the Find_Dir to DF_DESCENDING.

You can control the number of finds done by setting the Max_Finds. This is beneficial when working with large files where a single key press could slow down the system if you find every record starting with the entered character. I recommend you set the limit to 10. After the first 10 matching records have been found, it jumps out of the find loop, even in descending order.

Below is the example code that created the image above:
    Object oDbform_DSFList1 is a cDbform_DSFList

        Set Alt_Data_File  To Country.File_Number
        Set Alt_Data_Field To 1 // Country.Name

        Set Float_Index to 1
        Set Max_Finds to 15
        Set Enter_Find to TRUE
        Set Label to "Country:"
        Set Size to 13 186
        Set Location to 57 64


    End_Object    // oDbform_DSFList1


We will describe here how-to install this package into the orderentry workspace
  • Copy the *.pkg file to the .\Order\AppSrc folder
  • Copy the *.dfc and *.bmp files to the .\Order\IdeSrc folder
  • Open your IDE and go to the tools menu, select Maintain classlist
  • Select the workspace tabpage as we want to install this in one workspace for now
  • Click the Add button to open the "Open a New Class In The Current Workspace" dialog and enter the following details:
    1. Name: cDbform_DSFList
    1. Image: cdbForm_dsflist.bmp
    1. Page : Data
    1. File: cDbform_DSFList
  • Click the ADD-button
  • Click Ok


Have a datafile for Cities. As the user types, they can select a City from the list. Modify your save routine to check if the city exists and add it if not. Then a simple entry screen for the users to edit any cities that maybe in the list to remove misspellings or duplicates (i.e. Clinton Township, Clinton Twp).

Download ~ 7 kb