百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
W

WinUI.TableView

> 数据库
开源

一个适用于 WinUI 的轻量级 TableView/DataGrid。

346 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个适用于 WinUI 的轻量级 TableView/DataGrid。

WinUI.TableView

WinUI.TableView is a lightweight and fast data grid control made for WinUI apps and now supports the Uno Platform. It is easy to use, and capable of handling large numbers of items with a focus on performance. It's derived from ListView so you will experience fluent look and feel in your project. It comes with all the essential features you need, plus extras like an Excel like column filter, options buttons (for columns and the TableView) and easy data export.

Samples App

Explore the interactive WinUI.TableView samples with code snippets in a Samples App on Microsoft Store or Uno Platorm WASM:

Features

  • Auto-generating Columns: Automatically generate columns based on the data source.
  • Individual cell selection: You can select any cell for the ease of access and better editing experience.
  • Copy row or cell content: TableView allows you to copy rows or cells content, with the option to include or exclude column headers.
  • Editing: Modify cell content directly within the TableView by double tapping on a cell. Learn more →
  • Sorting: Offers built in column sorting. Learn more →
  • Grouping: Multi-level column grouping with expand/collapse and full sort integration (Windows only). Learn more →
  • Excel-like Column Filter: TableView allows you to filter data within columns with an excel like flyout to enhance data exploration and analysis. Learn more →
  • Export functionality: Built-in export functionality to export data to CSV format. This feature can be enabled by setting the ShowExportOptions = true. Learn more →
  • Grid Lines: Display grid lines to improve data visibility and organization.
  • Localization: Support for multiple languages to enhance usability for global audiences.
  • Alternate Row Colors: Apply alternate row coloring for better readability and aesthetics.
  • Cell & Row Context Flyout: Provides context flyouts for cells and rows to allow quick actions. Learn more →
  • Row Detail Template: Displays expandable additional content for each row using RowDetailsTemplate. Learn more →
  • Row Headers: Adds header for each rows to display custom content using RowHeaderTemplate. Learn more →
  • Editing Events: Provides events to control and respond to cell edit lifecycle actions. Learn more →
  • Column Clipboard Binding: Enables custom clipboard copy behavior by binding column values for copy operations. Learn more →
  • Column Reordering: Allows users to drag and rearrange columns at runtime. Learn more →
  • Frozen Columns: Keeps specified number of columns fixed in place while horizontally scrolling. Learn more →
  • Compact Mode Support: Reduces row height and padding for higher data density layouts. Fluent Compact sizing
  • Conditional Cell Styling: Applies dynamic styles to rows or cells based on data-driven conditions. Learn more →

Browse the full documentation at w-ahmad.dev/WinUI.TableView

Uno Platform Support

WinUI.TableView is compatible with the Uno Platform, enabling you to use the control across multiple platforms. Try the Uno WASM Sample App here https://tableview.samples.w-ahmad.dev/

See the Uno Platform getting started guide for setup instructions.

Getting Started

For a complete walkthrough, see the Getting Started guide in the documentation.

1. Create a New WinUI 3 or Uno Project

If you don't already have a WinUI 3 project or Uno project, create one in Visual Studio.

2. Install NuGet Package

Install WinUI.TableView NuGet package to your app with your preferred method. Here is the one using NuGet Package Manager:

bash
Install-Package WinUI.TableView

3. Add WinUI.TableView to Your XAML

In your MainWindow.xaml, add the WinUI.TableView control:

xaml

    
        
    

4. Bind Data to TableView

In your MainPage.xaml.cs, set up the data context and bind data to the TableView:

csharp
public sealed partial class MainWindow : Window
{
    public MainViewModel ViewModel { get; } = new MainViewModel();

    public MainWindow()
    {
        this.InitializeComponent();
    }
}

Create a simple MainViewModel with a collection of items to display:

csharp
public class MainViewModel
{
    public ObservableCollection Items { get; set; }

    public MainViewModel()
    {
        Items = new ObservableCollection
        {
            new Item { Name = "Item 1", Price = 10.0, Quantity = 1 },
            new Item { Name = "Item 2", Price = 15.0, Quantity = 2 },
            new Item { Name = "Item 3", Price = 20.0, Quantity = 3 },
            // Add more items here
        };
    }
}

public class Item 
{
    public string Name { get; set; }
    public double Price { get; set; }
    public int Quantity { get; set; }
}

5. Run Your Application

Build and run your application. You should see the TableView populated with the rows and cells from your ViewModel.

Native AOT Compatibility

TableView relies heavily on runtime bindings and dynamic value resolution, which are not fully compatible with IL trimming and Native AOT by default.

To use TableView in Native AOT applications, bound types should be decorated with the WinRT.GeneratedBindableCustomProperty attribute to preserve the required binding metadata.

cs
[WinRT.GeneratedBindableCustomProperty]
public partial class Person
{
    public string Name { get; set; }

    public int Age { get; set; }
}

See the AOT compatibility docs for more details.

Customization

You can customize the appearance and behavior of the TableView by modifying its properties, templates, and styles. For example:

  • Column Customization: Define custom columns based on data types.
  • Is ReadOnly: You can make any column or the TableView itself read only.
  • Sorting, Grouping, and Filtering: Enable sorting, grouping, and filtering on specific columns or for the all columns.
  • Corner Button Mode: Use the CornerButtonMode property to configure the corner button's behavior. You can select from:
    • None: No corner button.
    • SelectAll: Displays a "Select All" button.
    • Options: Displays an options menu.
  • Column Header and Cell Styles: Customize the styles for column headers and cells to match your application's theme or specific design requirements.
xml

    
        
        
        
            
                
                    
                
            
            
                
                    
                
            
        
    

Available Column Types

For full details on each column type, see the Column Types documentation.

  1. TableViewTextColumn
  2. TableViewCheckBoxColumn
  3. TableViewComboBoxColumn
  4. TableViewNumberColumn
  5. TableViewToggleSwitchColumn
  6. TableViewTemplateColumn
  7. TableViewTimeColumn
  8. TableViewDateColumn
  9. TableViewHyperlinkColumn

Documentation

Full documentation is available at w-ahmad.dev/WinUI.TableView, including:

  • Getting Started
  • Getting Started with Uno Platform
  • Defining Columns
  • Column Types
  • Binding Data
  • Editing
  • Sorting
  • Grouping
  • Filtering
  • Selection
  • Styling & Theming
  • Performance
  • API Reference

Contributing

Contributions are welcome from the community! If you find any issues or have suggestions for improvements, please submit them through the GitHub issue tracker or consider making a pull request.

Contributors

License

This project is licensed under the MIT License.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#cross-platformdatagridtableviewuno

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库