This Knowledge Base shows a canonical example of how to use the QueryViewer control.
The example's scenario recreates the classical Invoicing data model.
Screenshots of this Knowledge Base can be found at Basic Samples - QueryViewer.