Skip to content

Cannot copy value of TableViewTemplateColumn #347

@Mangepange

Description

@Mangepange

Copying does not include values from TableViewTemplateColumns.
I do set the ClipboardContentBinding property, and the same binding works if setting on a TableViewTextColumn.

It looks like maybe an if-statement in TableView.GetCellsContent is wrong, since it checks if the column is a TableViewBoundColumn and not a TableViewColumn (and the template columns does not inherit from TableViewBoundColumn).

        foreach (var row in slots.Select(x => x.Row).Distinct())
        {
            var item = Items[row];

            for (var col = minColumn; col <= maxColumn; col++)
            {
                if (Columns.VisibleColumns[col] is not TableViewBoundColumn column ||
                   !slots.Contains(new TableViewCellSlot(row, col)))
                {
                    stringBuilder.Append(separator);
                    continue;
                }

                var content = isClipboardContent ? column.GetClipboardContent(item) : column.GetCellContent(item);
                stringBuilder.Append($"{content}{separator}");
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions