How to Use the ProMatrix List Grid Builder

1. Set Up the Form’s Data Environment and Properties

At anytime after you have set up a form’s Data Environment  and properties, you can use the ProMatrix List Grid Builder to place a picklist grid on the form.

Tip: When creating a form that will contain a List Grid, you will normally use the ProMatrix PageFrame Builder to place pageframes on the form (see ProMatrix PageFrame Builder).

2. Add the Grid_List Container to the Form

1.   Display the controls from the VPMCTRLS.VCX, DEVCTRLS.VCX or PROCTRLS.VCX class library on the Form Controls Toolbar.

2.   Right click on the pageframe and select Edit. Then click on the tab of the page to which the List Grid will be added.

3.   Click the Grid_List container on the Form Controls Toolbar and click the page selected in step 2 to drop the container on the page.

4.   Size the container as desired. (You can always resize later.)

3. Run the ProMatrix List Grid Builder

1.   Right click on the container and select Edit. Right click on the container again and select Builder from the popup menu. VPM Enterprise displays the Builder Selection dialog.

    

2.   Select ProMatrix List Grid Builder from the Builder Selection dialog. VPM Enterprise displays the ProMatrix List Grid Builder.

    

3.   On the ProMatrix Grid List Builder enter/select the following items:

·       Select Fields: The ProMatrix List Grid Builder shows the fields from the InitialSelectedAlias table, view or CursorAdapter. Move the fields you want in the grid from the Unselected Fields list to the Selected Fields list.

·       Order Fields: The fields in the Selected Fields list will be placed in the grid in the order in which they are listed. Therefore, change the order of the fields so that the order meets your specifications.

View & CursorAdapter Note: The Order Tag combo box is disabled for a view or CursorAdapter. For a view or CursorAdapter, Incremental Search tags are created at runtime if Case Sensitive or Not Case Sensitive is chosen for a field.

4.   Selected Field Properties: When you highlight a field in the Selected Fields list, the Selected Field Properties box shows:

·       Caption: The field Description (Short) property entry from the Data Builder. The Grid Builder will put the Caption in the field’s grid Header Caption property.

Tip: After the grid is built, you can change a header caption on a grid column to something other than the field Description (Short) entries in the Data Builder. To do this, select the Header object in the Property window and change it's Caption property to the text you want. Then, set the lGridOverrideCaption property of the field’s control in the grid to .T. (true).

Tip: If you want to override the Data Builder field Description (Short) entries of all fields in the grid, set the grid’s lGridOverrideCaption property to .T. Then, enter the header captions you want in each field’s Header Caption property.

·       Order Tag: If you want to make the field’s grid column sortable, select a tag for the field in the Order Tag combo box.

5.   Incremental Search: If you want to provide incremental search for a field, first select an Order Tag for the field. Then, select the Case Sensitive or Not Case Sensitive option button.

6.   Case Sensitive: Selecting the Case Sensitive option button makes the incremental search case sensitive.

7.   Not Case Sensitive: Selecting the Not Case Sensitive option button makes the incremental search not case sensitive if you also do one of the following when the InitialSelectedAlias is a table:

·       Alternative 1 - Create Upper Index Tag: Create an index tag for the field that uses the UPPER function in the index expression to force the tag to upper case. Select this tag as the Order Tag. (Not necessary for views or CursorAdapters.)

·       Alternative 2 - Upper Field Format Property: Enter a Format property for the field in the Data Builder that uses the “!” symbol to force entry into the field on a form to upper case. If you do this, the Order Tag you select for the field does not have to use the UPPER function. (Not necessary for views or CursorAdapters.)

Warning: Do not use Alternative 2 if the data in the field already contains mixed or lower case entries.

8.   Calculated Fields: The ProMatrix List Grid Builder allows you to easily create calculated fields for a List Grid. To create a calculated field for a grid column:

·       Click the Calc button at the bottom of the column of buttons on the Grid List Builder. The Grid List Builder displays the Visual FoxPro Expression Builder.

·       Create your calculation expression in the Expression Builder. When you close the Expression Builder, the calculation expression will be added to the Selected Fields list with the prefix “Calc:”.

·       Set up the Selected Field Properties for the calculated field as described above.

·       You can edit a calculated field by selecting the field in the Selected Fields list and clicking the Calc button.

4. Build Grid

After you have set up the Grid List as you want it, click the Build button. The ProMatrix Grid List Builder will build the picklist grid for you.

5. Test and Clean Up

After the Grid List Builder creates the picklist grid, you will want to test it. Run the form from the Form Designer or the VPME Form Editor and select the picklist grid. If you want to run the form from your application, build the application first.

You may need to clean up the grid. In particular, if a grid header caption is much longer than the field displayed in the column, you may want to reduce the size of the header.

To make changes to a form’s picklist grid control, simply open the form in the Form Designer, right click on the Grid_List container, select Edit, right click on the container again, select Builder and run the Grid List Builder. The Grid List Builder will display the fields and field properties that you previously selected. Make any changes you want and click Build. You may have to resize the picklist grid after it is rebuilt.

More:

Creating a Mover Form