Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

AllowMergeFromPrevious Property, CellBaseClass Class

Defines whether this cell is eligible to be used for cell merging by the previous adjacent cell.

Class: CellBaseClass
Namespace: Softelvdm.Controls
Assembly: Softelvdm.SftTreeNET

Syntax

public BoolOptionalEnum AllowMergeFromPrevious { get; set; }
Public Property AllowMergeFromPrevious As BoolOptionalEnum

Value

True if this cell is eligible to be used for cell merging by the previous adjacent cell, otherwise False.

The default value is BoolOptionalEnum.Default.

Comments

Defines whether this cell is eligible to be used for cell merging by the previous adjacent cell.

For cell merging to take effect, the previous adjacent cell merging into this cell must have its CellBaseClass.EvaluatedMergeWithNext property set to True. The merged cell (this cell) must have its property CellBaseClass.EvaluatedAllowMergeFromPrevious set to True to indicate that it is a candidate for cell merging. In addition, all subordinate cells must be empty.

HeadersClass.AllowMergeFromPreviousDefault for column headers, FootersClass.AllowMergeFromPreviousDefault for column footers and ColumnClass.AllowMergeFromPreviousDefault for each column.

The CellBaseClass.EvaluatedAllowMergeFromPrevious property can be used to determine the actual status for this cell by evaluating the default settings.

Examples

C#

            tp.Format |= StringFormatFlags.DirectionVertical;
            sftTree1.Headers[0, 1].Parts.Add(tp);
            sftTree1.Headers[0, 1].Parts.Add(new ImagePartClass(img));
            tp = new TextPartClass("Cell merging in\na column header");
            sftTree1.Headers[0, 1].Parts.Add(tp);

            // Horizontally merge column header cells in row 1, columns 3 + 4
            sftTree1.Headers[1, 3].MergeWithNext = BoolOptionalEnum.True;
            sftTree1.Headers[1, 4].AllowMergeFromPrevious = BoolOptionalEnum.True;
            sftTree1.Headers[1, 3].Text = "Horizontally merged cells";
            sftTree1.Headers[1, 3].Image = img;
            sftTree1.Headers[1, 4].Parts.Clear();

            // Vertically merge some cells in the column footer (in the last column)
            sftTree1.Footers.MaxLines = 4; // allow up to 4 text lines 
            for (int r = 1; r < sftTree1.Footers.Rows; ++r) {

VB.NET

    tp.Format = tp.Format Or StringFormatFlags.DirectionVertical
    sftTree1.Headers(0, 1).Parts.Add(tp)
    sftTree1.Headers(0, 1).Parts.Add(New ImagePartClass(img))
    tp = New TextPartClass("Cell merging in" & vbCrLf & "a column header")
    sftTree1.Headers(0, 1).Parts.Add(tp)

    ' Horizontally merge column header cells in row 1, columns 3 + 4
    sftTree1.Headers(1, 3).MergeWithNext = BoolOptionalEnum.True
    sftTree1.Headers(1, 4).AllowMergeFromPrevious = BoolOptionalEnum.True
    sftTree1.Headers(1, 3).Text = "Horizontally merged cells"
    sftTree1.Headers(1, 3).Image = img
    sftTree1.Headers(1, 4).Parts.Clear()

    ' Vertically merge some cells in the column footer (in the last column)
    sftTree1.Footers.MaxLines = 4 ' allow up to 4 text lines 
    For r As Integer = 1 To sftTree1.Footers.Rows - 1

See Also CellBaseClass Class | Classes | SftTree/NET 2.0