Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Binding to Data
   [Collapse]Grid View
    [Expand]Columns and Card Fields
    [Expand]Rows and Cards
    [Expand]Row, Column and Cell Access API
    [Expand]Split Presentation
    [Collapse]Cell Merging
      Cell Merging Overview
      Tutorial: Cell Merging
    [Expand]Row Preview Sections
    [Expand]Scrolling
   [Expand]View Technology
   [Expand]Grouping
   [Expand]Sorting
   [Expand]Summaries
   [Expand]Data Editing
   [Expand]Filtering and Locating Rows
   [Expand]Focus and Selection Handling
   [Expand]Processing Rows
   [Expand]Formatting Cell Values
   [Expand]Master-Detail Relationships
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Expand]Appearance and Conditional Formatting
   [Expand]Batch Modifications
   [Expand]Hit Information
   [Expand]Hints
   [Expand]Popup Menus
   [Expand]Saving and Restoring Layouts
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End-User Capabilities
    Included Components
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Cell Merging Overview

The cell merging feature allows neighboring cells with identical values to be merged. This gives your users an alternative manner with which to view the information on thescreen. The image below shows a Grid View with the cell merging feature enabled.

Expanded Online Video

Learn how to enable the cell merging feature for an entire View or individual columns, and how to change the algorithm that determines if two neighboring cells are to be merged.

Expanded Overview

The cell merging feature is only supported by the grid and banded grid Views. By default, it is disabled. To activate it, set the View's GridOptionsView.AllowCellMerge option to true. This option can be accessed using the GridView.OptionsView property. When the View's cell merging mechanism is enabled, you can still prevent cells from being merged for individual columns, if required. Set the desired columns' OptionsColumn.AllowMerge option to false for this purpose.

An AdvBandedGridView View does not support the cell merging feature, because this View allows column cells to be arranged in several lines. So, cells that belong to a single column may not be neighbors. If it is necessary to have the bands and the Cell Merging feature, use the BandedGridView View instead.

Expanded Cell Merging via Code

You can also control how cells are merged by handling the GridView.CellMerge event, which allows the cell merging behavior to be customized manually. By default, merged cells display the value of the cell residing at the top of the merged area even if the actual values in the merged cells are different. In this case, you can also handle the GridView.CustomDrawCell or ColumnView.CustomColumnDisplayText events to provide display values for merged cells.

The following sample code handles the GridView.CellMerge event to merge the cells in the Balance column that have the same sign. The GridView.CustomDrawCell event is handled to provide an appropriate display text for merged cells.

The image below shows the result.

Expanded Cell Merging Limitations

When the cell merging feature is activated, the following restrictions are applied.

Expanded See Also

How would you rate this topic?​​​​​​​