Page cover

Overview

KtTable is a modern, feature-rich data table component for WinForms that provides beautiful rendering, custom cell types, and instant search functionality. Built on top of KtColor, KtBrush, and KtIcons for consistent theming and styling.


Basic Setup

Designer Properties


Column Configuration

Column Types

KtTable supports multiple column types:

  • Icon - SVG icons

  • Avatar - User avatars with icons

  • Text - Standard text content

  • Badge - Status badges with colored backgrounds

  • Progress - Progress bars with gradient support

Defining Columns


Creating Rows

Basic Row Creation

Populating Multiple Rows


Cell Types

1. Icon Cell

Display SVG icons with color support.

Parameters:

  • name - Icon identifier from Tabler icon set

  • color - Tuple of two KtColor values for gradient or state colors


2. Avatar Cell

Display user avatars with icon backgrounds.

Parameters:

  • icon - Icon name to display in avatar

  • foreground - Color of the icon

  • background - Tuple of KtColor values for gradient background


3. Badge Cell

Display status badges with colored backgrounds.

Parameters:

  • value - Text to display in badge

  • foreground - Text color (use ! operator to invert)

  • background - Background color


4. Progress Cell

Display progress bars with gradient support.

Parameters:

  • value - Current progress value

  • color - KtBrushGradient for the progress bar

  • max - Maximum value (default: 100)


5. Text Cell

Display standard text content.

Usage:

  • Simply assign string values directly to text columns

  • No special formatting required


Properties

Color Properties

Display Properties

Behavior Properties

Layout Properties


Rendering

Render Method

Call Render() after adding or modifying rows to update the display.

Best Practice:

  • Add all rows first, then call Render() once

  • Avoid calling Render() inside loops for better performance


Complete Example


Tips & Best Practices

Performance

  • Batch Operations: Add all rows before calling Render()

  • Search Latency: Adjust Latency property for search responsiveness

  • Column Width: Set explicit widths for performance with large datasets

Styling

  • Color Consistency: Use theme colors (PRIMARY, ACCENT, NEUTRAL) for consistency

  • Gradients: Use KtBrushGradient for modern, vibrant progress bars

  • Icons: Use Tabler icon naming convention: tabler.icon.name

Data Management

  • Primary Keys: Mark one column as IsPrimaryKey for row identification

  • Search: All columns have Search = true by default for instant filtering

  • Sorting: Configure SortMode per column as needed


JSON Integration

KtTable includes built-in JSON parsing for API integration:


Advanced Features

Custom Colors

Dynamic Theming

Color Inversion


Summary

KtTable provides a complete modern table solution with:

  • โœ… Custom scrollbars - No ugly default scrollbars

  • โœ… Rich cell types - Icons, Avatars, Badges, Progress bars

  • โœ… Instant search - Real-time filtering with debounce

  • โœ… KtColor integration - Consistent theming and gradients

  • โœ… SVG icons - Crisp Tabler icons at any size

  • โœ… JSON support - Built-in parsing for API integration

  • โœ… High performance - Optimized rendering for large datasets

For more information about KtColor, KtBrush, and KtIcons, refer to their respective documentation.

Last updated

Was this helpful?