Skip to content

TableView: add FrozenColumnCount (pinned/frozen columns while scrolling horizontally) #21788

Description

@xuxiaokang0723

Describe the bug / feature request

Feature request: Add frozen / pinned columns support to TableView (Avalonia 12.1+).

TableView is a great lightweight, read-only tabular control in core Avalonia. For many real-world operator / monitoring UIs, the main missing piece versus DataGrid is the ability to keep the leftmost columns visible while scrolling horizontally (equivalent to DataGrid.FrozenColumnCount).

Without frozen columns, apps that need a always-visible identity/action column (e.g. row menu + primary key) are forced to stay on the heavier DataGrid, even when they only need read-only display.

To Reproduce

N/A (feature request). Current docs: https://docs.avaloniaui.net/controls/data-display/structured-data/tableview

Expected behavior

Something like:

<TableView ItemsSource="{Binding Items}" FrozenColumnCount="2">
  <TableView.Columns>
    <TableViewColumn Header="" Width="48" CellTemplate="{StaticResource ActionsTemplate}" />
    <TableViewColumn Header="Id" Binding="{Binding Id}" Width="110" />
    <TableViewColumn Header="Status" Binding="{Binding Status}" Width="130" />
    <!-- more scrollable columns -->
  </TableView.Columns>
</TableView>

Expected:

  • The first N columns stay fixed on the left during horizontal scroll
  • Headers stay aligned with cells
  • Vertical scrolling still keeps frozen and scrollable parts row-aligned
  • Selection / virtualization continue to work

Optional stretch goals (nice to have, not required for v1):

  • Per-column IsFrozen as an alternative / complement to FrozenColumnCount
  • Visual separator between frozen and scrollable regions

Avalonia version

12.1.0

OS

Windows (also relevant for Android / Browser WASM where touch + wide tables are common)

Additional context

  • Original TableView scope intentionally kept minimal (#21237, implemented in #21511): read-only, no sorting/grouping/reordering.
  • Frozen columns feel like a natural incremental feature for the “lightweight table” niche, and already exist on DataGrid (FrozenColumnCount) and TreeDataGrid.
  • Workarounds today:
    • Keep using DataGrid (heavier than needed for read-only)
    • Compose two synchronized tables (fragile: selection, zebra striping, touch scroll)
    • Fork / customize TableView presenters (high maintenance)

Happy to help validate a prototype from an industrial WCS monitoring app (wide read-only location/task tables with a sticky action + id column).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions