Home CSS Editor Reports Office Gallery Download Order Contacts

Intro

Another one grid? Who needs one more grid when we already have DBGridEh, NextGridAdvGridTreeView (where you can draw almost anything), and king of the grids - DX QuantumGrid.

But this grid is very different. Imagine a grid where every cell is an independent interactive web page. So it can display a text, an image, image inside a text, table, chart, chart and table, expandable sections and tree, checkboxes, buttons, links, hints… anything.

  

 

Every element inside a cell can show interactive HTML hint:

 

 And the only Delphi code used in the examples above is "Export selected orders" button handler.

How it works

The grid is based on famous TVirtualTreeView component. Data is loaded into the tree via SQL property

 

Child SQL is used to create a tree.

Rendering and behaviour is based on two main things:

  1. Templates
  2. Expressions 

Field template define cell content, it is an HTML Report Library template which can contain datapackets, charts, etc. Same for the hint templates.

 

Expressions are any valid Delphi expression (almost all standard functions can be used) which returns number, string or boolean.  For example, to sort customers by length of company name we define SortExpression for field as length(Company)

 

ImageExpression define image index for a field (in image list) and Expression is used to evaluate field value.

Also expressions are used for grid filtering - in the FilterExpression property.

Data source is not limited to SQL, using appropriate adapter data can be loaded  from XML, JSON, CSV or, f.e. file system:

 

Grid is scalable (by default using Ctrl+Wheel).

 

Cell content calculation

 Content in every cell is calculated in following order:

  1. Row attribute defined in column FieldName property.
  2. Expression defined in column Expression property.
  3. Format from Format property is applied to value. For date/time fields FormatDateTime function is used, for numeric fields - FormatFloat.
  4. Template is calculated in following order 
    1. (Field Name)_TEMPLATE row attribute,
    2. Column TemplateExpression property (calculated). 
    3. Column Template property.  

Image Index calculation

  1. OnGetImageIndexEx event
  2. OnGetImageIndex event
  3. Column ImageExpression
  4. Attribute defined in ImageAttr property. 

 Also you can select image list by its name using _IMAGELISTrow attribute.

 Sorting

Use Column.SortExpression to define expression used when sorting by this column. Expression should return value with same datatype as field (integer/date/string/etc.).