From c763ee24a3bc1edf61ffff2643719c839c626f0a Mon Sep 17 00:00:00 2001 From: Max Katz Date: Fri, 7 Jan 2022 02:09:49 -0500 Subject: [PATCH] Merge pull request #7315 from timunie/feature/EditableDatagridTemplateColumn Feature: editable `DataGridTemplateColumn` --- samples/ControlCatalog/Models/Person.cs | 15 ++++ .../ControlCatalog/Pages/DataGridPage.xaml | 12 ++++ .../ControlCatalog/Pages/DataGridPage.xaml.cs | 22 +++++- .../DataGridColumn.cs | 2 +- .../DataGridTemplateColumn.cs | 72 ++++++++++++++++--- 5 files changed, 110 insertions(+), 13 deletions(-) diff --git a/samples/ControlCatalog/Models/Person.cs b/samples/ControlCatalog/Models/Person.cs index 47f41bc584..cd70fa3959 100644 --- a/samples/ControlCatalog/Models/Person.cs +++ b/samples/ControlCatalog/Models/Person.cs @@ -16,6 +16,7 @@ namespace ControlCatalog.Models string _firstName; string _lastName; bool _isBanned; + private int _age; public string FirstName { @@ -59,6 +60,20 @@ namespace ControlCatalog.Models } } + + /// + /// Gets or sets the age of the person + /// + public int Age + { + get => _age; + set + { + _age = value; + OnPropertyChanged(nameof(Age)); + } + } + Dictionary> _errorLookup = new Dictionary>(); void SetError(string propertyName, string error) diff --git a/samples/ControlCatalog/Pages/DataGridPage.xaml b/samples/ControlCatalog/Pages/DataGridPage.xaml index 63e873d9b5..f7e3cf2441 100644 --- a/samples/ControlCatalog/Pages/DataGridPage.xaml +++ b/samples/ControlCatalog/Pages/DataGridPage.xaml @@ -64,6 +64,18 @@ + + + + + + + + + + + +