Language

QuickGrid<TGridItem>.ItemComparer Property

Definition

Gets or sets a comparer used during virtualization to detect whether items were prepended or appended between data loads. The comparer determines whether the first loaded item changed between loads, which indicates items were inserted above the current viewport, so the grid can keep the viewport anchored.

Provide a comparer that compares items by a stable unique identifier (for example, a primary key). Defaults to Default. For records and types implementing IEquatable<T>, the default works automatically (value equality). For reference types without value-equality semantics, the default falls back to reference equality, which produces false-positive prepend detection when the data source returns fresh instances between loads.

This only has an effect when Virtualize is true.

[Microsoft.AspNetCore.Components.Parameter]
public System.Collections.Generic.IEqualityComparer<TGridItem>? ItemComparer { get; set; }
[<Microsoft.AspNetCore.Components.Parameter>]
member this.ItemComparer : System.Collections.Generic.IEqualityComparer<'GridItem> with get, set
Public Property ItemComparer As IEqualityComparer(Of TGridItem)

Property Value

IEqualityComparer<TGridItem>
Attributes

Applies to