alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class MergeCellInfo

    Represents a merge definition for a rectangular region of cells in SfGrid<TValue>. The region is anchored at the specified top-left cell and extends by the provided row and column spans within the current view.

    Inheritance
    object
    MergeCellInfo
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Blazor.Grids
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public sealed class MergeCellInfo
    Remarks

    Indices are zero-based and refer to the current view only (for example, current page, virtual block, or group segment). The anchor cell is the top-left cell of the merged region; all covered cells are suppressed from rendering and focus.

    Constraints:

    • RowIndex and ColumnIndex must point to a visible data row and a visible leaf data column.
    • RowSpan and ColumnSpan must be greater than or equal to 1.
    • Merges are computed per view and do not cross view boundaries or include hidden rows/columns.

    Usage: Create one or more MergeCellInfo instances and pass them to SfGrid<TValue>.MergeCells(...).

    Examples

    The following example merges a 2x3 region starting at row 1, column 1 in the current view, and demonstrates batching multiple merge requests.

    // Single merge
    grid.MergeCells(new MergeCellInfo
    {
        RowIndex = 1,
        ColumnIndex = 1,
        RowSpan = 2,
        ColumnSpan = 3
    });
    
    // Batch merge
    grid.MergeCells(new[]
    {
        new MergeCellInfo { RowIndex = 0, ColumnIndex = 0, RowSpan = 2, ColumnSpan = 1 },
        new MergeCellInfo { RowIndex = 5, ColumnIndex = 2, RowSpan = 1, ColumnSpan = 2 }
    });

    Constructors

    MergeCellInfo()

    Declaration
    public MergeCellInfo()

    Properties

    ColumnIndex

    Gets or sets the zero-based column index of the anchor cell among visible leaf data columns.

    Declaration
    public int ColumnIndex { get; set; }
    Property Value
    Type Description
    int

    An int representing the visible leaf column index in the current view. The default value is 0.

    Remarks

    Must reference a visible leaf data column; non-leaf or hidden columns are not valid merge anchors.

    ColumnSpan

    Gets or sets the number of columns to include in the merge starting at ColumnIndex.

    Declaration
    public int ColumnSpan { get; set; }
    Property Value
    Type Description
    int

    An int indicating the horizontal span of the merged region. The default value is 1.

    Remarks

    Must be greater than or equal to 1. Values larger than the remaining visible leaf columns in the current view are truncated to fit.

    RowIndex

    Gets or sets the zero-based row index of the anchor cell within the current view (data rows only).

    Declaration
    public int RowIndex { get; set; }
    Property Value
    Type Description
    int

    An int representing the data row index in the current view. The default value is 0.

    Remarks

    Must be greater than or equal to 0 and within the bounds of the current view.

    RowSpan

    Gets or sets the number of rows to include in the merge starting at RowIndex.

    Declaration
    public int RowSpan { get; set; }
    Property Value
    Type Description
    int

    An int indicating the vertical span of the merged region. The default value is 1.

    Remarks

    Must be greater than or equal to 1. Values larger than the remaining rows in the current view are truncated to fit.

    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved