Grids are perhaps the most important user-interface element in both Alventis and Designer. It is also one that is both exceptionally powerful and rather complex, so we will take a close look at Grids in this topic.


A Grid has columns and records that are sometimes also called rows.




In its most basic shape depicted above, you can scroll around to view all available records and their columns. You can also edit their values using the Grid cells. In most cases, you will first focus the desired cell by either clicking it with the mouse or by navigating to it with the keyboard's arrow/cursor keys. The record is now highlighted, and the focused cell within it is inverse-highlighted, which is a euphemism for saying "doesn't look highlighted".

To edit the cell's contents, you have several choices:

Start typing. The moment you start typing, you find yourself "inside" the cell, entering the text you already started typing. Old text, if any, gets replaced.
Hit Enter. You find yourself in the cell with its old text selected. This gives you an opportunity to edit the existing text.
Click the focused cell with the mouse. Works just like Enter above.


There are a few Grids in Alventis and Designer that behave slightly differently, at least in some of their columns. The difference can be that as soon as you click a cell with the mouse, you find yourself right away inside the cell (as if you had already clicked the cell once, and then the second time). Other than that, everything else works the same.


Once you have entered the new text in the cell, you have a few ways to get out:

Hit Enter. This may do one of two things, depending on the Grid: it will typically just "close" the cell and you will find yourself as you were before you entered into it: the cell is focused but not active. Some Grids will automatically place you in the next column's cell as a service to you.
Hit Escape. Your modifications, if any, are abandoned and you're out of the cell.
Hit Tab. You are out of the cell and the next cell gets focused, but not activated, i.e., you're not "inside" it.
Click somewhere with the mouse. This is terribly boring, but it will accept your changes and focus the clicked cell.


Creating Records. You can insert a new record in a grid by focusing the grid (or any cell within it) and hitting the Insert key on the keyboard. Some grids do not allow creation of new records, in which case nothing will happen.


Deleting Records. You can delete the focused record by hitting Delete or Ctrl-Delete on the keyboard. Once again, some grids may not allow you to delete their records.


Saving Records. Once you have modified one or more cell values for a record, you must post your changes (i.e., save the record). To do so, you must simply focus any other record in the grid: just moving up or down by one record is sufficient. If the modified record is the only record in the grid, you can achieve the same effect by "pretending" to insert a new record: hit the Insert key to create a new record. You find yourself in the new empty record, and the previous modified record has been posted since it is no longer focused. You can now hit Escape to cancel the insert operation (unless inserting just happens to be exactly what you want to do at this time). In an InfoView grid, you can also post the changes using the Post button DataNavigatorBar_Post on the InfoView's toolbar.



Moving around in the grid is quite intuitive. If you are currently in an active cell, you may want to get out of it though by clicking Enter, Escape, or Tab as described above. Once the cell is merely focused, you can focus and cycle through cells and records using the Tab key. You can also move in the desired direction using the cursor/arrow keys, and all the other usual document-navigation keystrokes: Home, End, Ctrl-Home, Ctrl-End, PageUp, PageDown, Ctrl-PageUp, Ctrl-PageDown.



Moving Columns. In most Grids, you can re-order columns. Simply drag the column by its header (caption rectangle) from its current position to a new one between other columns.



Sizing Columns. You can make columns as narrow or as wide as you wish. Just drag the divider line between column headers where you want. Double-clicking the divider line sets the width of the column just to the left automatically according to the contents of the column.





Sorting. Most Grids allow sorting. Sort by the desired column's values by clicking the column's header with the mouse. To toggle between Ascending and Descending sort order, just click the column header again. You will notice a little sorting arrow appear in the header of the column by which the Grid is sorted.




You can remove sorting from a column by Ctrl-clicking its header.

You can also sort by more than one column. Shift-clicking a column header preserves whatever sorting may exist in any other columns, essentially adding that column to the list of sorting ones.

Sorting may not be supported either by the Grid or by a specific column. You will notice this... well, when it doesn't work.



Grouping. Grouping is an exceptionally powerful feature that arranges grid records by common column values.

You may be familiar with the concept of Grouping from other software. If not, playing with it for 2 minutes should be enough to understand how it works and what it does, so we'll offer just one simplistic example. Imagine a grid full of car records. Each record will list such things as Make and Model each in its own column. If you group the grid by the Make column, that column no longer appears in the grid itself. Instead, each unique Make value now appears in its own grouping row. Under each of these grouping rows, will be listed records that correspond to that Make.




To group the Grid by a particular column, drag that column's header into the Group by Box at the top of the Grid. Grids that don't display this box do not support grouping.


You can group by more than one column at a time. Just repeat grouping for as many columns as you like.

You can group in a specific order and rearrange that order directly in the Group by Box by dragging column headers where you want them to appear in that multi-level grouping hierarchy.


Ungrouping. You can ungroup by dragging the column header from the Group by Box back into the Grid's header row. You can also "put it back" by dragging it from the Group by Box and dropping it outside the Grid.




Grouping implies sorting, so if you group the grid by a column, it gets automatically sorted by that column. You can change the sort direction by clicking the column header as usual.

You can expand or collapse individual grouping rows. You can click the little Plus button with the mouse, double-click anywhere on the row (except in the Queries List grid where this action opens the double-clicked Query), or hit the '+' key on the keyboard (the one in the numeric keypad area on the far right). To collapse an open group, click the little Minus button with the mouse, double-click the row, or hit the '-' key (again, in the numeric keypad area). The numeric keypad '*' key will expand a group and all its sub-groups in case of multi-level grouping.



Column Hiding. Only the UniGrid Search Results Grid supports column hiding. You can hide columns you don't wish to see by dragging them outside the Grid and dropping them into "nowhere". The column vanishes from the Grid. To unhide the column, click the Trashcan button BarIfxTrashcan that is now shown in the right-hand corner of the Group by Box. This displays a pop-up Customization list of hidden columns. You can drag them back into the Grid's header row or Group by Box.






Many Grids allow you to display a subset of available records by specifying certain Filter Criteria. The simplest kind of criterion is by a column's value. Click the Filter button in the right corner of the column's header.

You are presented with a menu of the following choices:

(All) means "show all records", i.e., no filtering by this column



(Custom...) will open a Custom Filter dialog box for the current column. It allows you to specify a filtering expression with a few logical operators.


Values the rest of the menu displays a potentially long list of values found in this column. Selecting a particular value will simply set the filter expression to "Column value must equal <whatever you chose>".


You can filter in the above fashion by more than one column.



Whenever filtering is in effect, a Filter Box appears at the bottom of the Grid.


It textually displays the current filter expression. You can remove filtering completely by clicking the gray Close Filter button on the left. The checkbox right next to it will temporarily disable the filter but will not remove it. A little "down" arrow button (shown on the snapshot below) allows you to pick one of the recently used filters from a list.




Custom Filtering. At the far right end of the Filter Box you will find the Customize button that opens the Filter Builder dialog.




The dialog may take a few minutes to wrap your head around, but it is basically quite intuitive. The cursor turns into a "hand" when you pass it over items you can change. Click the mouse to see a pop-up list of available choices.


We are not going into further detail here on the assumption that if you can successfully build a custom filter expression using multiple sub-expressions and Boolean logic, you can undoubtedly figure out this dialog. You can save and reload filter expressions using the Open and Save As buttons.


Dynamic Summaries are described in their own chapter on Grid Summaries.



Grid Cell Auto Height. Normally, Grids display each record on one line, so any text that doesn't fit in a cell is simply cut-off. Clicking the Grid Cell Auto Height toggle button BarIfxCellAutoHeight can turn On or Off the mode where each record occupies as much space as it needs to fully display its cell's contents. Such "oversized" contents may be strings of long text or pictures.