Data Grid | WinForms Controls (2024)

  • 7 minutes to read

The WinForms Data Grid is a high-performance UI component powered by the DirectX rendering engine. The Data Grid (GridControl) ships with a flexible View-based architecture and includes numerous data shaping and UI customization features. The Data Grid can display and edit data from any data source of any size and complexity.

Data Grid | WinForms Controls (1)

Watch Video: Getting Started Run Demo

Bind to Data

The Data Grid supports the following data sources and binding modes:

  • ADO.NET Data Sets
  • SQL Data
  • Entity Framework Data
  • XML Data
  • Excel Data Sources
  • LinQ To SQL
  • MongoDB
  • JSON
  • WCF Data Services
  • IList and IEnumerable
  • DevExpress ORM Tool (XPO)
  • Real-Time Data Display
  • Ultra-Fast Asynchronous and Synchronous Server Modes[1]
  • Unbound Columns[2]

With its integrated Data Source Configuration Wizard, you can bind the Data Grid without writing a single line of code.

Read the following topic for information on supported technologies and data sources: Data Binding.

Note

The Data Grid does not support unbound mode. The grid cannot function without a data source.

Data Presentation Views

The Data Grid control uses Views to display data from a data source. Views specify the presentation and layout of data records and fields. Views include a comprehensive set of edit, display, behavior, and appearance options.

  • Traditional Table (Grid View)
  • Banded Grid View
  • Advanced Banded Grid View
  • Card View
  • Carousel (Layout View)
  • Windows Explorer View
  • Tile View and Kanban Board

Data Grid | WinForms Controls (2)

Grid View

Data Grid | WinForms Controls (3)

Banded Grid View

Data Grid | WinForms Controls (4)

Card View

Data Grid | WinForms Controls (5)

WinExplorer View with HTML & CSS Markup Support

Data Grid | WinForms Controls (7)

Kanban Board - Tile View

Data Grid | WinForms Controls (8)

Tile View with HTML & CSS Templates

Data Grid | WinForms Controls (9)

Items View - HTML & CSS Templates

Data Grid | WinForms Controls (10)

Layout/Carousel View

Read the following topic for details: Get Started with Data Grid and Views.

DirectX Hardware Acceleration

With DirectX hardware acceleration, the Data Grid introduces a major increase in overall performance and HighDPI rendering quality (4K/8K).

Watch Video: DirectX vs GDI

HTML & CSS Markup Support

allows you to define data-aware templates quickly for Grid UI elements and create web-inspired user interfaces. This feature allows you to eliminate the use of property-based UI customizations and CustomDraw events.

Data Grid | WinForms Controls (11)

Watch Video Run Demo

Grid Customization

The Data Grid includes dozens of UI/UX customization options available to you and your users. Its advanced customization features include:

  • End-User Column Resize and Rearrangement
  • Show/Hide Columns and Bands / Column Customization Window
  • Column Auto-Width and Best Fit
  • Fixed Columns and Bands (Pinned Panes)
  • Split Presentation
  • Row Preview
  • Cell Merge
  • Cell and Row Selection
  • Horizontal and Vertical Scrolling
  • Scrollbar Annotations
  • Row Resize - Auto and Custom Row Height
  • Save and Restore Grid Layout

Watch Video

Group Data

You can group data against one or multiple columns in Grid Views, Banded Grid Views, and Advanced Banded Grid Views. Users can drag column headers and drop them onto the group panel to group data.

Data Grid | WinForms Controls (12)

Data grouping features include:

  • Group Data by Column Values or Display Text
  • Interval Grouping Inspired by MS Outlook
  • Inline Grouping
  • Merged Column Grouping
  • Master-Detail Grouping
  • Custom Grouping on Events
  • Fixed Group Rows
  • Sort Group Rows by Summary
  • Comprehensive API

Read the following topic to learn more: Data Grouping.

Watch Video Run Demo

Sort Data

The Data Grid ships with high-speed multi-column sorting. With its comprehensive sorting API, you can sort data in all Views and implement custom sorting algorithms. Users can sort data in Grid Views, Banded Grid Views, Advanced Banded Grid Views, Layout Views, and Card Views.

Read the following topic to learn more: Sorting.

Watch Video Run Demo

Data Summaries and Aggregates

Data Grid | WinForms Controls (13)

Grid Views, Banded Grid Views, and Advanced Banded Grid Views support the following data aggregation options:

  • Automatic Summaries (Average, Count, Min, Max, Sum)
  • Total Summaries (against all rows)
  • Group Summaries (against grouped data)
  • Custom Summaries
  • Summary Context Menu
  • Show multiple total summaries for a single column
  • Display Group Summaries in Footers and Group Rows
  • Format Summary Values
  • Sort Group Rows by Summary

Read the following topic to learn more: Summaries.

Watch Video Run Demo

Edit and Validate Data

The Data Grid allows you to incorporate over 35 individual data editors, sparklines, and charts within grid cells. Users can edit cell values in-place or in a separate edit form.

Data Grid | WinForms Controls (14)

Advanced data editing features include:

  • New Item Row (add new records)
  • Edit Data Inline
  • Inline and Modal Edit Forms
  • Create Custom Edit Forms
  • Edit Masks and HTML Formatting
  • Input Validation and Error Indication
  • Embedded Data Navigator
  • Comprehensive Data Editing API

Read the following topic to learn more: Data Editing and Validation.

Watch Video Run Demo

Data Filtering and Search

Data Grid | WinForms Controls (15)

The Data Grid includes a comprehensive set of filter and custom query options.

  • Integrated Find Panel (CTRL+F)
  • Incremental Search
  • Auto-Filter Row
  • Excel-Inspired Filter Dropdowns
  • Filter History (Most Recently Used Filters)
  • Filter Criteria Editor
  • Group Filters

Read the following topic to learn more: Filter and Search.

Watch Video Run Demo

Focus and Selection

Users can navigate between grid cells (move cell focus) with a mouse and keyboard. The Data Grid also supports multiple cell and row/card selection. Grid Views and Banded Grid Views can display a column with checkboxes that allows users to select rows.

Data Grid | WinForms Controls (16)

Read the following topics for more information on row/cell selection:

  • Focus Grid Cells
  • Move Row Focus
  • Multiple Row and Cell Selection
  • Built-In Check Column and Selection Binding
  • Data Navigation UI

Run Demo

Format Cell Values

Column editors automatically format cell values according to the editor’s type and settings. Built-in text formatting options include:

  • Composite Formatting
  • HTML Text Formatting
  • Custom Formatting
  • Standard and Custom Format Specifiers

Read the following topic for detailed information on how to format cells with HTML tags, events, and masks: Format Cell Values.

Excel-Inspired Conditional Formatting

Conditional Formatting allows you and your users to highlight cells and rows with animated data bars, icons, and predefined color scales based on specified criteria.

Data Grid | WinForms Controls (17)

You can use predefined format rules or create custom rules. The Data Grid ships with both a design-time and runtime Conditional Formatting Rule Editor.

Read the following topic to learn more: Conditional Formatting.

Watch Video Run Demo

Master-Detail

The Data Grid allows you to create Master-Detail layouts with any number of nesting levels and any number of details at each level. You can display master tables in Grid Views, Banded Grid Views, or Advanced Banded Grid Views, and show detail tables in any View type.

Data Grid | WinForms Controls (18)

The Data Grid automatically enables master-detail mode if data source records contain a property (or properties) of a collection type. See the following topic for detailed information and examples: Master-Detail Relationships.

Note

Use one of the following techniques to implement master-detail functionality for data sources that cannot organize master-detail relationships at the data layer:

  • Implement the IRelationList interface for your data source.
  • Handle the grid control’s master-detail events.

Run Demo

Print and Export

You can print and export Data Grid content to multiple file formats (PDF, XLS, XLSX, MHT, CSV, HTML, RTF, DOCX, TXT, IMAGE). Read the following topics for detailed information and examples:

  • Printing Overview
  • Export Overview
  • Export to XLS and XLSX
  • Advanced Grid Printing and Exporting

Appearance Customization

The Data Grid supports multiple appearance options/techniques.

  • DevExpress Application Skins
  • Property-Based Appearance Customization
  • Custom Draw API - Manual Painting

Drag-and-Drop Rows

Users can drag and drop data items (rows, tiles, etc.) inside or outside the Data Grid. Read the following topic for details and examples: Drag-and-Drop Grid Rows.

Run Demo

Design-Time Customization

The Data Grid ships with a powerful Visual Studio IDE designer and intuitive customization interface designed to simplify setup. Design-time UI/UX customization options include:

  • Grid Designer
  • Level Designer
  • Data Source Configuration Wizard
  • On-form Band and Column Customization

Miscellaneous Features

  • Iterate All/Visible Rows
  • Asynchronous Image Load in WinExplorer and Tile Views
  • Batch Modifications - Eliminate Excessive Updates
  • Save and Restore Grid Layout
  • Hit Information
  • Hints
  • Popup Menus

Troubleshooting

Common Issues and Troubleshooting - WinForms Grid Control

Footnotes

  1. Use Server modes for extremely large data sets. Even if your data source contains millions of records, the grid maintains its performance because it loads records in small portions on demand and performs data-related operations (data sorting, filtering, and summary calculation) on the server side. Server modes replace traditional data pagination. Read the following topic for details: Large Data Sources: Server and Instant Feedback Modes.

  2. Unbound columns allow you to display custom data. Values for these columns can be calculated according to an expression or within an event handler. See the following topic for details and examples: Unbound Columns.

See Also

Examples

Data Grid | WinForms Controls (2024)
Top Articles
Latest Posts
Article information

Author: Lakeisha Bayer VM

Last Updated:

Views: 6062

Rating: 4.9 / 5 (49 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Lakeisha Bayer VM

Birthday: 1997-10-17

Address: Suite 835 34136 Adrian Mountains, Floydton, UT 81036

Phone: +3571527672278

Job: Manufacturing Agent

Hobby: Skimboarding, Photography, Roller skating, Knife making, Paintball, Embroidery, Gunsmithing

Introduction: My name is Lakeisha Bayer VM, I am a brainy, kind, enchanting, healthy, lovely, clean, witty person who loves writing and wants to share my knowledge and understanding with you.