### Complete MainPage.xaml Structure Source: https://docs.telerik.com/devtools/winui/getting-started/first-steps-nuget Full example of a page containing the RadDataGrid control definition. ```XAML ``` -------------------------------- ### Merge Generic.xaml in App.xaml Source: https://docs.telerik.com/devtools/winui/getting-started/first-steps-nuget Include the Telerik theme resources in the application's resource dictionary to ensure proper styling. ```XAML ``` -------------------------------- ### Add Required Namespaces Source: https://docs.telerik.com/devtools/winui/getting-started/first-steps-nuget Include these namespaces in your MainPage.xaml.cs file to support data binding and collection management. ```C# using Telerik.Core; using System.Collections.ObjectModel; ``` -------------------------------- ### Implement Model and ViewModel Source: https://docs.telerik.com/devtools/winui/getting-started/first-steps-nuget Define a data model class inheriting from ViewModelBase and a ViewModel class to manage the collection of data items. ```C# public class Club : ViewModelBase { private string name; private DateTime established; private int stadiumCapacity; public Club(string name, DateTime established, int stadiumCapacity) { this.name = name; this.established = established; this.stadiumCapacity = stadiumCapacity; } public string Name { get { return this.name; } set { if (value != this.name) { this.name = value; this.OnPropertyChanged("Name"); } } } public DateTime Established { get { return this.established; } set { if (value != this.established) { this.established = value; this.OnPropertyChanged("Established"); } } } public int StadiumCapacity { get { return this.stadiumCapacity; } set { if (value != this.stadiumCapacity) { this.stadiumCapacity = value; this.OnPropertyChanged("StadiumCapacity"); } } } } public class MyViewModel : ViewModelBase { private ObservableCollection clubs; public ObservableCollection Clubs { get { if (this.clubs == null) { this.clubs = this.CreateClubs(); } return this.clubs; } } private ObservableCollection CreateClubs() { ObservableCollection clubs = new ObservableCollection(); Club club; club = new Club("Liverpool", new DateTime(1892, 1, 1), 45362); clubs.Add(club); club = new Club("Manchester Utd.", new DateTime(1878, 1, 1), 76212); clubs.Add(club); club = new Club("Chelsea", new DateTime(1905, 1, 1), 42055); clubs.Add(club); return clubs; } } ``` -------------------------------- ### Declare DataGrid Namespace Source: https://docs.telerik.com/devtools/winui/getting-started/first-steps-nuget Add the required XML namespace declaration to use Telerik Grid controls in XAML. ```XAML xmlns:telerikGrid="using:Telerik.UI.Xaml.Controls.Grid" ``` -------------------------------- ### Define RadDataGrid Control Source: https://docs.telerik.com/devtools/winui/getting-started/first-steps-nuget Instantiate the RadDataGrid control within the XAML layout. ```XAML ``` -------------------------------- ### Bind Data to RadDataGrid in XAML Source: https://docs.telerik.com/devtools/winui/getting-started/first-steps-nuget Sets the DataContext to a ViewModel and binds the ItemsSource property of the RadDataGrid to a collection. ```xml ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.