!!! This file is used by TGDEMO.MAK ... you don't need to read it. !!! # Intro Welcome to the TrueGrid demonstration package. You are in the NAVIGATOR, which allows you to read about each TrueGrid demo, then try it yourself to see how it works. Use the PgDn key or scrollbar to read the rest of this introduction. You can also resize the NAVIGATOR window so you can see more or less text. ----- TrueGrid is a bound database browser grid for Visual Basic 3.0 Data Access. It is remarkably easy to use, quite capable, and priced sensibly. Our goal in designing TrueGrid was to provide you with high performance, high productivity, and good value. First, this demo program will be described. At the end of this intro page, you can find out how to order TrueGrid if you like what you see here. ----- Use the scroll bar at the upper left to move from this introduction to the description of each demo. If you want to run the demo, press the "Try It" button at the upper right. The navigator will then describe the demo's operation. You can stop running this program at any time to peruse the source code for each demo. Each demo is numbered. For each numbered demo, there is a separate Visual Basic form whose name is "TGDEMOn.FRM" where "n" is the number of the demo. This makes it easy to view the demo source code to see how it works. This demo will only work in Visual Basic design mode, since the demo version of TrueGrid won't work in compiled applications. If you like TrueGrid, and want one of your very own, please order one from Apex Software at 1-800-858-APEX. TrueGrid is only $69 (US) and comes with a 30-day money-back guarantee. Our technical support is excellent, and we listen carefully to your comments and suggestions. # Demo #1 This demo shows how simple it is to use TrueGrid using all of the default settings. A form is displayed which shows the default TrueGrid, browsing a small customer database. This demo contains no code whatsoever. # Demo #1X This demo shows how simple it is to use TrueGrid using all of the default settings. READ THIS FIRST, then click on the "Demo 1 - Simple TrueGrid" title to bring the demonstration form to the front so you can try it. To create this demo, we did the following: 1. Put a data control on the form, and set it to the customer.dbf database. 2. Dropped a TrueGrid on the form and set the DataSource property. >> Observe: This demo contains no code. You can edit data, move from record to record, and rearrange or resize columns using the mouse. To edit, click on a cell to make it current, then click again to enter cell editing mode. You can also just begin typing and TrueGrid will enter edit mode automatically. When done, press the ENTER key. Note that the updated text will appear RED until you move the record pointer using the data control or by clicking on another row in the grid. That's when the actual update occurs. Notice that the grid will "listen" to anything you do with the data control. Move the record pointer to the first record, the last record, or move forward or backward by one record at a time. The grid automatically senses what you do and there is absolutely no coding necessary. # Demo #2 This demo shows how well TrueGrid and other bound controls work together. A grid, combined with three Visual Basic Text controls work togther to browse and update data. The grid properties have also been set to show the enhanced 3D appearance. This demo contains no code whatsoever. # Demo #2X This demo shows how well TrueGrid and other bound controls work together. READ THIS FIRST, then click on the "Demo 2 - Multiple Controls" title to bring the demonstration form to the front so you can try it. >> Observe: This demo contains no code. As you move the grid pointer by clicking on a cell, the text boxes automatically show the current row. If you edit data in the grid, then change the row number, the text boxes will show the edited data (when you make that row current again). Similarly, if you change data in a text box, then move the pointer, the grid automatically shows the updated data in the old row. >> To create this demo, we did the following: 1. Put a data control on the form, and set it to the customer.dbf database. 2. Dropped a TrueGrid on the form and set the DataSource property. 3. Used the TrueGrid design-time layout editor to pre-configure the column layout and sizes for this demo. 4. Put three text boxes, linked to individual database fields via their DataSource and DataField properties. 5. Set TrueGrid properties HorzLines, HorzColor, VertLines, VertColor, BackColor and MarqueeStyle to enhance the grid appearance. # Demo #3 This demo shows how database actions taken by program code are automatically sensed by TrueGrid. This is an enhanced version of Demo2 which contains buttons for Update, AddNew, Delete. It also contains buttons for First, Next, Previous, and Last. Although these duplicate the function of the data control, they demonstrate how methods like MoveFirst can be used to cause grid movement. # Demo #3X This demo shows how database actions taken by program code are automatically sensed by TrueGrid. READ THIS FIRST, then click on the "Demo 3 - Code Interaction" title to bring the demonstration form to the front so you can try it. >> Observe: This demo works like Demo2. You can move the grid pointer as well as update data in the grid or text controls. The Update button will force an immediate update. For example, if you change a cell in the grid, but don't move to a new row, the edited cell changes color to let you know that the data was changed. If you click Update, it forces the grid (and other controls) to write their data to the database. The Delete button deletes the record you are currently pointing to (don't delete too many ... this file is used by other demos). The AddNew button will create a new, empty record at the bottom of the grid. >> To create this demo, we did the following: 1. Put a data control on the form, and set it to the customer.dbf database. 2. Dropped a TrueGrid on the form and set the DataSource property. 3. Used the TrueGrid design-time layout editor to pre-configure the column layout and sizes for this demo. 4. Put three text boxes, linked to individual database fields via their DataSource and DataField properties. 5. Created seven buttons and put the proper code in each (1-3 lines per button). 6. Set TrueGrid properties HorzLines, HorzColor, VertLines, VertColor, BackColor and MarqueeStyle to enhance the grid appearance. # Demo #4 This demo shows how multiple records can be selected and highlighted using TrueGrid's BookmarkList feature. Records can be selected manually, or multiple records can be automatically selected by providing an expression. This demonstration is somewhat more complicated and shows quite a few features. # Demo #4X This demo shows how multiple records can be selected and highlighted using TrueGrid's BookmarkList feature. READ THIS FIRST, then click on the "Demo 4 - Multiple Selection" title to bring the demonstration form to the front so you can try it. >> Observe: This demo highlights several features, but mainly serves to demonstrate how multiple row selection can be performed. Here are some things you may want to try: 1. Move the mouse to the leftmost edge of the grid ... a checkmark appears. You can click to select a row, or click to deselect one which is already selected. 2. The horizontal scroll bar allows you to move from one selected row to another. Select a few rows throughtout the database, then move from one to another using the scroll bar. 3. The "Clear All" button will deselect all of the selected rows. 4. At the bottom, the power of the grid's selection capability is illustrated by allowing an expression to be used to add items to the selection. Choose one of the expressions from the combo box (or type your own if you wish), then click "Execute" to select each of the rows which matches the criteria. The "Execute" button ADDS records to the selection, so click "Clear All" if you want to see only those which match. Performing operations like those in this demo is very easy. The best way to find out is to explore the code in the Demo4 form. >> Other tidbits This demo actually JOINs 2 databases using an SQL select statement which appears in the Data Control RecordSource property. Although it's not really important to the selection capability, you may find this interesting anyway. The Marquee has been changed to highlight only the current cell, while the selected rows are highlighted in blue. You may want to experiment with the SelectedBackColor, SelectedForeColor, and MarqueeStyle properties to see what other combinations are possible. # Demo #5 This demo shows how TrueGrid responds to various SQL queries. A grid is displayed with an area to enter SQL statements. By creating queries, you can easily see how TrueGrid reconfigures itself to match the results of the query. Some interesting queries are provided so you can quickly experiment with the demo. # Demo #5X This demo shows how TrueGrid responds to various SQL queries. READ THIS FIRST, then click on the "Demo 5 - SQL" title to bring the demonstration form to the front so you can try it. >> Observe: At the bottom of the demo form, there is an "Execute" button with an area for editing SQL statements just to the right. At the very bottom, a drop-down provides some common SQL statements for you to try. Notice that TrueGrid changes its column headings in order to satisfy the result of the SQL query. Even queries such as: SELECT COUNT(*) FROM CUSTOMER cause TrueGrid to display a single column which holds the result of the count. (If you aren't that familiar with SQL, the above query results in a count of the total number of records in the table.) Try each of the sample queries to see how they operate. Then, if you wish, you may want to enter some SQL statements yourself to see how TrueGrid responds. The code for this demo is quite simple. The SQL statement is simply assigned to the data control's RecordSource property, then the Refresh method is used on the data control. TrueGrid does the rest. # Demo #6 This demo links two grids together to show how related databases can displayed in multiple tables on a form. A grid containing COMPOSERS is displayed, and another containing their COMPOSITIONS. When you select a composer, the second grid automatically responds by showing just those compositions which belong to the selected composer. This demo contains only a few lines of code, and illustrates how simply TrueGrid events can be used to create sophisticated interfaces. # Demo #6X This demo links two grids together to show how related databases can displayed in multiple tables on a form. READ THIS FIRST, then click on the "Demo 6 - Linked Grids" title to bring the demonstration form to the front so you can try it. >> Observe: The form contains two TrueGrids and two data controls. The top grid and data control are linked to the COMPOSER.DBF database file, which contains a list of composers. The bottom grid and data control are linked to the OPUS.DBF database file, which contains a list of compositions for composers. Each database has a last name field, called "LAST". When you click on a composer in the top grid, it automatically formulates an SQL query on the second data control. This causes the second grid to respond and show the proper compositions. All of the code is in the RowChange event handler for the top grid, which looks like this: lastname$ = Data1.Recordset("LAST") Data2.RecordSource = "SELECT * FROM OPUS WHERE LAST " + chr$(34) + lastname$ + chr$(34) Data2.Refresh RowChange is triggered each time the first grid detects that a new row has become current, whether by clicking on the grid, or by moving the current position using the data control (or Visual Basic code). Thus, the list of compositions will always be kept current, no matter what is done to the first database. Easy? We think so. # Demo #7 This demo shows how TrueGrid can be used independently of a database. Instead of automatically fetching data from a database, TrueGrid is configured so that the programmer provides the data to be displayed from any source they wish. In the case of this demo, the grid is used to display a directory listing of the current directory, including file name, date, and file size. # Demo #7X This demo shows how TrueGrid can be used independently of a database. READ THIS FIRST, then click on the "Demo 7 - Non-database Mode" title to bring the demonstration form to the front so you can try it. >> Observe: TrueGrid contains a property, DataMode, which specifies whether or not TrueGrid is linked to a database, or whether it gets data in some application-defined way. This latter mode is called "Application" mode, or sometimes "Callback" mode. We like to call it "Callback" mode since TrueGrid "calls back" to the application each time it needs data. This is different from the way other grids store data. Instead of storing the data for you, TrueGrid simply requests what it needs when it needs it. Thus, you can display millions or billions of lines of data if you have the data stored somewhere and can respond to TrueGrid's requests for fetching it. In this demo application, a file directory listing is shown. The DataMode is set to "Application" and each time TrueGrid needs information it calls the Fetch event. In the Fetch event, file information is returned to TrueGrid, which it then displays. Although programmers usually buy TrueGrid for its bound database capabilities, callback mode offers many advantages for displaying non-database data as well. #END