This example illustrates how to create WinUI DataGrid.
WinUI DataGrid (SfDataGrid) is used to display and manipulate tabular data. Its rich feature set includes functionalities like data binding, editing, sorting, filtering, and grouping. It has also been optimized to work with millions of records, as well as to handle high-frequency, real-time updates.
- Create a WinUI 3 desktop app for C# and .NET 5 or WinUI 3 app in UWP for C#.
- Add reference to NuGet.
- Import the control namespace Syncfusion.UI.Xaml.DataGrid in XAML or C# code.
- Initialize the SfDataGrid control.
<Page
x:Class="SfDataGridDemo.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SfDataGridDemo"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:syncfuion="using:Syncfusion.UI.Xaml.DataGrid"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Page.DataContext>
<local:ViewModel />
</Page.DataContext>
<Grid>
<syncfuion:SfDataGrid ItemsSource="{Binding Orders}" />
</Grid>
</Page>
Take a moment to peruse the WinUI DataGrid – Getting Started documentation, where you can find about SfDataGrid with code examples.
Visual Studio 2019 and above versions