Skip to main content
TeeGrid’s rendering system allows you to customize how cell content is displayed. You can use built-in renderers like checkboxes and progress bars, or create your own custom renderers for specialized visualization.

Understanding Renders

A renderer is a class derived from TRender that controls how cell content is painted. The base rendering hierarchy:
  • TRender — Base class with Paint method
  • TFormatRender — Adds format and borders
  • TTextRender — Adds text rendering with margins and alignment
  • TVisibleTextRender — Adds visibility control

Built-in Renderers

Boolean Renderer (Checkboxes)

Display boolean values as checkboxes:
Boolean render styles:
  • TBooleanRenderStyle.Check — Shows checkbox with checkmark
  • TBooleanRenderStyle.Text — Shows “True” or “False” as text

Progress Bar Renderer

Display numeric values as progress bars:

Expander Renderer

Create expandable/collapsible cells for hierarchical data:
Expander styles:

Password Renderer

Mask text content for password fields:

Creating Custom Renderers

Basic Custom Renderer

Create a simple custom renderer by overriding the Paint method:

Advanced Custom Renderer with Graphics

Draw custom graphics in cells:

Image Renderer

Display images in cells:

Render Data Structure

The TRenderData record passed to Paint contains:

Text Rendering Options

Text Alignment

Control how text is aligned within cells:

Text Trimming

Handle text overflow:

Borders and Decorations

Custom Borders

Add borders to individual sides of cells:

Hit Testing

Implement custom hit testing for interactive renderers:

Complete Example: Multi-State Icon Renderer

Best Practices

The Paint method is called for every visible cell. Avoid heavy calculations, file I/O, or object creation inside Paint. Cache resources when possible.
Call inherited Paint(AData) when you want default rendering before or after your custom painting. Don’t call it if you’re completely replacing the default rendering.
Always draw within AData.Bounds. Drawing outside these bounds can cause visual artifacts and overlap with adjacent cells.
Check if data is empty or invalid before rendering. Use AData.IsEmpty or validate the data format.

Styling

Configure colors, fonts, and borders

TRender API

Complete API reference for render classes

TPainter API

Drawing interface for custom rendering

Custom Editors

Create custom cell editors