diff --git a/samples/ControlCatalog/Pages/DataGridPage.xaml b/samples/ControlCatalog/Pages/DataGridPage.xaml index d1742c12b7..7b86bba6a9 100644 --- a/samples/ControlCatalog/Pages/DataGridPage.xaml +++ b/samples/ControlCatalog/Pages/DataGridPage.xaml @@ -18,7 +18,7 @@ - + diff --git a/samples/ControlCatalog/Pages/DataGridPage.xaml.cs b/samples/ControlCatalog/Pages/DataGridPage.xaml.cs index b8f63cf3e3..fea18aa5da 100644 --- a/samples/ControlCatalog/Pages/DataGridPage.xaml.cs +++ b/samples/ControlCatalog/Pages/DataGridPage.xaml.cs @@ -13,7 +13,7 @@ namespace ControlCatalog.Pages this.InitializeComponent(); var dg1 = this.FindControl("dataGrid1"); dg1.IsReadOnly = true; - + dg1.LoadingRow += Dg1_LoadingRow; var collectionView1 = new DataGridCollectionView(Countries.All); //collectionView.GroupDescriptions.Add(new PathGroupDescription("Region")); @@ -44,6 +44,11 @@ namespace ControlCatalog.Pages addButton.Click += (a, b) => collectionView3.AddNew(); } + private void Dg1_LoadingRow(object sender, DataGridRowEventArgs e) + { + e.Row.Header = e.Row.GetIndex() + 1; + } + private void InitializeComponent() { AvaloniaXamlLoader.Load(this); diff --git a/src/Avalonia.Controls.DataGrid/DataGridCell.cs b/src/Avalonia.Controls.DataGrid/DataGridCell.cs index 99efc5743d..e5fbfa1a81 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridCell.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridCell.cs @@ -19,7 +19,7 @@ namespace Avalonia.Controls private Rectangle _rightGridLine; private DataGridColumn _owningColumn; - bool _isValid; + bool _isValid = true; public static readonly DirectProperty IsValidProperty = AvaloniaProperty.RegisterDirect( @@ -191,7 +191,7 @@ namespace Avalonia.Controls PseudoClasses.Set(":edited", IsEdited); - // PseudoClasses.Set(":invalid", !IsValid); + PseudoClasses.Set(":invalid", !IsValid); } // Makes sure the right gridline has the proper stroke and visibility. If lastVisibleColumn is specified, the diff --git a/src/Avalonia.Controls.DataGrid/DataGridRowGroupHeader.cs b/src/Avalonia.Controls.DataGrid/DataGridRowGroupHeader.cs index e504fe73a8..0833247439 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridRowGroupHeader.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridRowGroupHeader.cs @@ -334,7 +334,7 @@ namespace Avalonia.Controls { if (_headerElement != null && OwningGrid != null) { - _headerElement.IsVisible = OwningGrid.AreColumnHeadersVisible; + _headerElement.IsVisible = OwningGrid.AreRowHeadersVisible; } } diff --git a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml index 85c1af10ef..94a6274a26 100644 --- a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml +++ b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml @@ -7,12 +7,10 @@ Color="#3F4346" /> - + ResourceKey="SystemChromeLowColor" /> + ResourceKey="SystemControlErrorTextForegroundBrush" /> + ResourceKey="SystemControlErrorTextForegroundBrush" /> - - -