diff --git a/Maui.DataGrid.Sample/Tests/PropertyTest.cs b/Maui.DataGrid.Sample/Tests/PropertyTest.cs index 4d20b18..b4e7ec0 100644 --- a/Maui.DataGrid.Sample/Tests/PropertyTest.cs +++ b/Maui.DataGrid.Sample/Tests/PropertyTest.cs @@ -23,7 +23,7 @@ public void TestPropertiesSetsProperly() TestProperty(DataGrid.HeaderBordersVisibleProperty, true, false); TestProperty(DataGrid.HeaderHeightProperty, 42, 44); TestProperty(DataGrid.IsRefreshingProperty, true, false); - TestProperty(DataGrid.IsSortableProperty, true, false); + TestProperty(DataGrid.SortingEnabledProperty, true, false); TestProperty(DataGrid.ItemSizingStrategyProperty, ItemSizingStrategy.MeasureAllItems, ItemSizingStrategy.MeasureFirstItem); TestProperty(DataGrid.ItemsSourceProperty, new[] { "a", "b", "c" }, new[] { "d", "e" }); TestProperty(DataGrid.NoDataViewProperty, new ContentView { Background = Colors.Aqua }, new ContentView { Background = Colors.Lime }); diff --git a/Maui.DataGrid/CompatibilitySuppressions.xml b/Maui.DataGrid/CompatibilitySuppressions.xml index 47d6199..0581123 100644 --- a/Maui.DataGrid/CompatibilitySuppressions.xml +++ b/Maui.DataGrid/CompatibilitySuppressions.xml @@ -36,6 +36,13 @@ lib/net7.0/Maui.DataGrid.dll true + + CP0002 + F:Maui.DataGrid.DataGrid.SortingEnabledProperty + lib/net7.0/Maui.DataGrid.dll + lib/net7.0/Maui.DataGrid.dll + true + CP0002 M:Maui.DataGrid.DataGrid.get_PageSizeList @@ -78,6 +85,13 @@ lib/net7.0/Maui.DataGrid.dll true + + CP0002 + M:Maui.DataGrid.DataGrid.get_SortingEnabled + lib/net7.0/Maui.DataGrid.dll + lib/net7.0/Maui.DataGrid.dll + true + CP0002 M:Maui.DataGrid.DataGrid.set_PullToRefreshCommandParameter(System.Object) @@ -113,6 +127,13 @@ lib/net7.0/Maui.DataGrid.dll true + + CP0002 + M:Maui.DataGrid.DataGrid.set_SortingEnabled(System.Boolean) + lib/net7.0/Maui.DataGrid.dll + lib/net7.0/Maui.DataGrid.dll + true + CP0002 F:Maui.DataGrid.DataGrid.PullToRefreshCommandParameterProperty @@ -148,6 +169,13 @@ lib/net8.0/Maui.DataGrid.dll true + + CP0002 + F:Maui.DataGrid.DataGrid.SortingEnabledProperty + lib/net8.0/Maui.DataGrid.dll + lib/net8.0/Maui.DataGrid.dll + true + CP0002 M:Maui.DataGrid.DataGrid.get_PageSizeList @@ -190,6 +218,13 @@ lib/net8.0/Maui.DataGrid.dll true + + CP0002 + M:Maui.DataGrid.DataGrid.get_SortingEnabled + lib/net8.0/Maui.DataGrid.dll + lib/net8.0/Maui.DataGrid.dll + true + CP0002 M:Maui.DataGrid.DataGrid.set_PullToRefreshCommandParameter(System.Object) @@ -225,4 +260,11 @@ lib/net8.0/Maui.DataGrid.dll true + + CP0002 + M:Maui.DataGrid.DataGrid.set_SortingEnabled(System.Boolean) + lib/net8.0/Maui.DataGrid.dll + lib/net8.0/Maui.DataGrid.dll + true + \ No newline at end of file diff --git a/Maui.DataGrid/DataGrid.xaml.cs b/Maui.DataGrid/DataGrid.xaml.cs index 7fabcdf..b384bde 100644 --- a/Maui.DataGrid/DataGrid.xaml.cs +++ b/Maui.DataGrid/DataGrid.xaml.cs @@ -511,11 +511,17 @@ private void SortAndPaginate(SortData? sortData = null) BindablePropertyExtensions.Create(40); /// - /// Gets or sets a value indicating whether the DataGrid is sortable. + /// Gets or sets a value indicating whether the DataGrid allows sorting. /// - public static readonly BindableProperty IsSortableProperty = + public static readonly BindableProperty SortingEnabledProperty = BindablePropertyExtensions.Create(true); + /// + /// Obsolete. Use instead. + /// + [Obsolete("IsSortableProperty is obsolete. Please use SortingEnabledProperty instead.")] + public static readonly BindableProperty IsSortableProperty = SortingEnabledProperty; + /// /// Gets or sets the font size for the DataGrid. /// @@ -1017,14 +1023,24 @@ public int HeaderHeight } /// - /// Gets or sets if the grid is sortable. Default value is true. + /// Obsolete. Use instead. + /// + [Obsolete("IsSortable is obsolete. Please use SortingEnabled instead.")] + public bool IsSortable + { + get => (bool)GetValue(SortingEnabledProperty); + set => SetValue(SortingEnabledProperty, value); + } + + /// + /// Gets or sets if the grid allows sorting. Default value is true. /// Sortable columns must implement /// If you want to enable or disable sorting for specific column please use property /// - public bool IsSortable + public bool SortingEnabled { - get => (bool)GetValue(IsSortableProperty); - set => SetValue(IsSortableProperty, value); + get => (bool)GetValue(SortingEnabledProperty); + set => SetValue(SortingEnabledProperty, value); } ///