Skip to content

Commit

Permalink
Adds release notes, adds note about in-memory data.
Browse files Browse the repository at this point in the history
  • Loading branch information
tesar-tech committed Nov 14, 2024
1 parent 20f2242 commit 723e7f1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,10 @@
<DocsAttributesItem Name="SortDirection" Type="SortDirection" Default="Default">
Column initial sort direction.
</DocsAttributesItem>
<DocsAttributesItem Name="SortComparer" Type="IComparer<TItem>" Default="null">
Gets or sets the custom comparer used for sorting the items in this column.
Note that this comparer can only be used with in-memory data.
</DocsAttributesItem>
<DocsAttributesItem Name="ReverseSorting" Type="bool" Default="false">
Whether the sort direction will be reversed.
</DocsAttributesItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@


<DocsPageSection>
<DocsPageSectionHeader Title="Sort Comparer">
<DocsPageSectionHeader Title="SortComparer">
<Paragraph>
The <code>SortComparer</code> feature allows you to define a custom sorting logic for a column by specifying an <code>IComparer&lt;TItem&gt;</code> implementation.
This is useful when you want to sort data based on complex or calculated criteria that go beyond the default alphabetical or numerical order.
Note that this comparer can only be used with in-memory data.
</Paragraph>
<Paragraph>
In this example, a custom comparer is applied to sort by the <code>FirstName</code> length, and then, for items with the same first name length, alphabetically by <code>LastName</code>.
Expand All @@ -76,7 +77,7 @@
</Paragraph>
</DocsPageSectionHeader>
<DocsPageSectionContent FullWidth Outlined>
<DataGridComparerExample />
<DataGridSortComparerExample />
</DocsPageSectionContent>
<DocsPageSectionSource Code="DataGridSortComparerExample" />
</DocsPageSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@
Added <Code>FixedColumnsPositionSync</Code> parameter. This parameter allows you to keep synchronizing the fixed columns, this is useful when you want to be adding new columns dynamically, and the columns need to be recalculated.
</Paragraph>

<Heading Size="HeadingSize.Is4">
New Parameter: SortComparer
</Heading>

<Paragraph>
Added <Code>SortComparer</Code> parameter. This parameter allows you to provide a custom comparer for sorting items in a column using custom logic. Note that this comparer can only be used with in-memory data sources.
</Paragraph>


<Heading Size="HeadingSize.Is4">
SelectedCell API
</Heading>
Expand Down
3 changes: 2 additions & 1 deletion Source/Extensions/Blazorise.DataGrid/DataGridColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,8 @@ public SortDirection CurrentSortDirection
[Parameter] public SortDirection SortDirection { get; set; }

/// <summary>
/// Gets or sets the custom comparer used for sorting the items in this column.
/// Gets or sets the custom comparer used for sorting the items in this column.
/// Note that this comparer can only be used with in-memory data.
/// </summary>
[Parameter] public IComparer<TItem> SortComparer { get; set; }

Expand Down

0 comments on commit 723e7f1

Please sign in to comment.