gbGrid

gbGrid is a dual-purpose application. It provides a full-featured, CSV/PSV editor. It also demonstrates the use of a standard ListView control as a fully editable grid with Excel-like cell navigation and selection capabilities. gbGrid provides multiple editing options - inplace editing, fixed place editing and a popup record editor.

I've prepared the following short, online tutorial videos to help you get started with gbGrid.

Download (v3.0, 250 KB)

To install, just unzip the contents of the distribution file into a folder of its own!

Feature List

gbGrid provides a wide variety of features, designed to emulate Excel spreadsheet selection, navigation and editing features. Most actions can be accomplished by keyboard or mouse.

Cell Selection

Mouse Navigation/Selection

KeyBoard Navigation

Single-Cell Editing

Multi-Cell Actions


Cell Editing

Individual cells may be edited in gbGrid at any of three locations:

There are a variety of ways to initiate cell editing. The following keyboard and mouse actions will initiate cell editing in the default editor, as set in the gbGrid toolbar.

If the user sets ENTER to act as the down arrow, it cannot be used to initiate cell editing.

Regardless of the default editing location, these additional commands are available to initiate cell editing at a location of choice:

Inplace and Fixed Place cell editing may be closed in the following ways.

The Edit Record dialog can be closed with one of the following:


Undo

gbGrid offers only a limited form of Undo. When the Cut/Delete, Insert Date/Time, Number/Currency, and Fill All/Right/Down commands are issued, the modified cell block is saved to the Undo queue. The location of the cell block is not stored in the undo queue, so it is up to the user to make sure, before using Undo, that the currently selected cell is where the undo action is to take place. Undo is effectively a paste of the Undo queue.

Once Undo is applied, the undo queue is cleared.

I suggest using Undo immediately after executing Cut/Delete, Insert Date/Time, Number/Currency, or Fill All/Right/Down commands.


Multi-Line Values

Cells can contain multiple lines of text. The InPlace and Fixed Place editors, however, can only display the first line of text. The Edit Record dialog can display, and edit, all lines of text in a cell.

The Inplace and Fixed Place editors will display the first line only of a multi-line cell value, but will display " ..." at the end of the line to indicate that additional, unseen, information is available.

If used to edit a multi-line cell value, the InPlace and Fixed Place editors will truncate the additional lines.

Here's an image showing the selected cell "Superman ...", where the "..." means there are multiple lines of text. The popup Edit Record dialog is displayed, showing the multiple line of text.

In the actual cell value (i.e., in the data file), each of the lines much be separated by $DQ+$LF+$DQ, which is the line feed surrounded by double quotes.


Toolbar

Many gbGrid features and settings are accessed through the toolbar buttons.


Context Menu

Two grid context menus are provided, one for the header and one for the client area of the ListView.

Header Context Menu
Right click on any ListView column header to get this context menu:

ListView Context Menu
Right click on any of the cells to get this context menu:


Key Actions

The following keyboard actions are supported:


Mouse Actions

The following mouse actions are supported:


Keyboard Shortcuts

The following key combinations are available to the user to access gbGrid features:


gbGrid Limitations

gbGrid is not a control. So you cannot simple use Control Add to incorporate it into your application. Further, the current version of gbGrid supports only one grid per application. I'm reasonably sure it's possible to modify the code to handle both limitations, but I've not tried to take the code that far.

There are also some Excel features which gbGrid does not provide. These are not high on my godo list!

Of course, if I (or someone else) come up with a suggestion that would be easy or straightforward to implement, I've been known to be easily distracted! Creation of a control might especially be a task of interest, as I've never written a control before.


gbGrid GoDo List

This list of items are features I'd like to add, but just haven't gotten around to them yet.


Other Comments

Comments and suggestions are welcome!