mobile databases, mobile forms, and mobile synchronization … where you need to work
Providing Pocket Access, Mobile Database, Windows CE Database, and Windows CE Development Solutions

Tip of the Month (August 2008)

Navigational Grid Control

Visual CE already has a navigational dropdown control. The navigational dropdown allows the end user to select an entry in the dropdown and have the form move to that record. You can also make a grid control navigational: the user would click on an entry on the grid and then the form moves to that record.

Say you have a table called PERSON. Each record in the PERSON table has a unique PERSON_ID (which is an indexed column).

The first thing you want to do is create a macro to position to the new record. Select EDIT | MACRO/EVENTS. When Visual CE asks you for a macro name, enter "GRID SEARCH" (click the NEW button if you need to get the prompt). Create a macro with the following steps:

    Step 1: SORT BY: set "Col" to PERSON_ID
    Step 2: RECORD | SEARCH: set "Arg" to @var(34)
Click CLOSE to close the macro editor.

Then create your grid control. When asked to "Select the search key", select "Show all records" and press OK. In the properties in the lower right, in the " current..." settings, set @var(34) to current PERSON_ID.

Still in the properties of the grid control, click the "Events" button. Set the "Changed" event to "GRID SEARCH".

Previous Tips of the Month