RadCollectionView
Represents the ultimate data visualization control for .NET MAUI applications, providing enterprise-grade performance and functionality for displaying and interacting with collections of data.
Definition
Namespace:Telerik.Maui.Controls
Assembly:Telerik.Maui.Controls.dll
Syntax:
public class RadCollectionView : RadLayout
Inheritance: objectRadLayoutRadCollectionView
Derived Classes:
Inherited Members
Constructors
Initializes a new instance of the RadCollectionView class with default settings. Creates an empty collection view ready to be configured with data source, layout, and templates.
public RadCollectionView()
Fields
AutoExpandGroupsProperty
BindableProperty
Identifies the AutoExpandGroups bindable property.
public static readonly BindableProperty AutoExpandGroupsProperty
AutomaticLoadOnDemandTemplateProperty
BindableProperty
Identifies the AutomaticLoadOnDemandTemplate bindable property.
public static readonly BindableProperty AutomaticLoadOnDemandTemplateProperty
CurrentItemProperty
BindableProperty
Identifies the CurrentItem bindable property.
public static readonly BindableProperty CurrentItemProperty
DisplayMemberPathProperty
BindableProperty
Identifies the DisplayMemberPath bindable property.
public static readonly BindableProperty DisplayMemberPathProperty
DragDropBehaviorProperty
BindableProperty
Identifies the DragDropBehavior dependency property.
public static readonly BindableProperty DragDropBehaviorProperty
DragVisualTemplateProperty
BindableProperty
Identifies the DragVisualTemplate dependency property.
public static readonly BindableProperty DragVisualTemplateProperty
DropIndicatorTemplateProperty
BindableProperty
Identifies the DropIndicatorTemplate dependency property.
public static readonly BindableProperty DropIndicatorTemplateProperty
EmptyContentDisplayModeProperty
BindableProperty
Identifies the EmptyContentDisplayMode bindable property.
public static readonly BindableProperty EmptyContentDisplayModeProperty
EmptyContentTemplateProperty
BindableProperty
Identifies the EmptyContentTemplate bindable property.
public static readonly BindableProperty EmptyContentTemplateProperty
EnableStickyGroupHeadersProperty
BindableProperty
Identifies the EnableStickyGroupHeaders bindable property.
public static readonly BindableProperty EnableStickyGroupHeadersProperty
EndItemSwipeCommandProperty
BindableProperty
Identifies the EndItemSwipeCommand dependency property.
public static readonly BindableProperty EndItemSwipeCommandProperty
EndSwipeLengthProperty
BindableProperty
Identifies the EndSwipeLength dependency property.
public static readonly BindableProperty EndSwipeLengthProperty
EndSwipeTemplateProperty
BindableProperty
Identifies the EndSwipeTemplate dependency property.
public static readonly BindableProperty EndSwipeTemplateProperty
FilterDescriptorsProperty
BindableProperty
Identifies the FilterDescriptors bindable property.
public static readonly BindableProperty FilterDescriptorsProperty
FooterTemplateProperty
BindableProperty
Identifies the FooterTemplate bindable property.
public static readonly BindableProperty FooterTemplateProperty
GroupDescriptorsProperty
BindableProperty
Identifies the GroupDescriptors bindable property.
public static readonly BindableProperty GroupDescriptorsProperty
GroupHeaderTemplateProperty
BindableProperty
Identifies the GroupHeaderTemplate bindable property.
public static readonly BindableProperty GroupHeaderTemplateProperty
GroupTapCommandProperty
BindableProperty
Identifies the GroupTapCommand bindable property.
public static readonly BindableProperty GroupTapCommandProperty
GroupViewStyleProperty
BindableProperty
Identifies the GroupViewStyle bindable property.
public static readonly BindableProperty GroupViewStyleProperty
GroupViewStyleSelectorProperty
BindableProperty
Identifies the GroupViewStyleSelector bindable property.
public static readonly BindableProperty GroupViewStyleSelectorProperty
HeaderTemplateProperty
BindableProperty
Identifies the HeaderTemplate bindable property.
public static readonly BindableProperty HeaderTemplateProperty
HorizontalScrollBarVisibilityProperty
BindableProperty
Identifies the HorizontalScrollBarVisibility bindable property.
public static readonly BindableProperty HorizontalScrollBarVisibilityProperty
IsDragDropEnabledProperty
BindableProperty
Identifies the IsDragDropEnabled dependency property.
public static readonly BindableProperty IsDragDropEnabledProperty
IsItemSwipeEnabledProperty
BindableProperty
Identifies the IsItemSwipeEnabled dependency property.
public static readonly BindableProperty IsItemSwipeEnabledProperty
IsLoadOnDemandActiveProperty
BindableProperty
Identifies the IsLoadOnDemandActive bindable property.
public static readonly BindableProperty IsLoadOnDemandActiveProperty
IsLoadOnDemandEnabledProperty
BindableProperty
Identifies the IsLoadOnDemandEnabled bindable property.
public static readonly BindableProperty IsLoadOnDemandEnabledProperty
ItemHoldCommandProperty
BindableProperty
Identifies the ItemHoldCommand bindable property.
public static readonly BindableProperty ItemHoldCommandProperty
ItemsLayoutProperty
BindableProperty
Identifies the ItemsLayout bindable property.
public static readonly BindableProperty ItemsLayoutProperty
ItemsSourceProperty
BindableProperty
Identifies the ItemsSource bindable property.
public static readonly BindableProperty ItemsSourceProperty
ItemTapCommandProperty
BindableProperty
Identifies the ItemTapCommand bindable property.
public static readonly BindableProperty ItemTapCommandProperty
ItemTemplateProperty
BindableProperty
Identifies the ItemTemplate bindable property.
public static readonly BindableProperty ItemTemplateProperty
ItemViewStyleProperty
BindableProperty
Identifies the ItemViewStyle bindable property.
public static readonly BindableProperty ItemViewStyleProperty
ItemViewStyleSelectorProperty
BindableProperty
Identifies the ItemViewStyleSelector bindable property.
public static readonly BindableProperty ItemViewStyleSelectorProperty
LoadOnDemandBufferItemsCountProperty
BindableProperty
Identifies the LoadOnDemandBufferItemsCount bindable property.
public static readonly BindableProperty LoadOnDemandBufferItemsCountProperty
LoadOnDemandCommandProperty
BindableProperty
Identifies the LoadOnDemandCommand bindable property.
public static readonly BindableProperty LoadOnDemandCommandProperty
LoadOnDemandModeProperty
BindableProperty
Identifies the LoadOnDemandMode bindable property.
public static readonly BindableProperty LoadOnDemandModeProperty
ManualLoadOnDemandTemplateProperty
BindableProperty
Identifies the ManualLoadOnDemandTemplate bindable property.
public static readonly BindableProperty ManualLoadOnDemandTemplateProperty
SelectedIndexProperty
BindableProperty
Identifies the SelectedIndex bindable property.
public static readonly BindableProperty SelectedIndexProperty
SelectedItemProperty
BindableProperty
Identifies the SelectedItem bindable property.
public static readonly BindableProperty SelectedItemProperty
SelectedItemsProperty
BindableProperty
Identifies the SelectedItems bindable property.
public static readonly BindableProperty SelectedItemsProperty
SelectionGestureProperty
BindableProperty
Identifies the SelectionGesture bindable property.
public static readonly BindableProperty SelectionGestureProperty
SelectionModeProperty
BindableProperty
Identifies the SelectionMode bindable property.
public static readonly BindableProperty SelectionModeProperty
SortDescriptorsProperty
BindableProperty
Identifies the SortDescriptors bindable property.
public static readonly BindableProperty SortDescriptorsProperty
StartSwipeLengthProperty
BindableProperty
Identifies the StartSwipeLength dependency property.
public static readonly BindableProperty StartSwipeLengthProperty
StartSwipeTemplateProperty
BindableProperty
Identifies the StartSwipeTemplate dependency property.
public static readonly BindableProperty StartSwipeTemplateProperty
SwipeCompletedCommandProperty
BindableProperty
Identifies the SwipeCompletedCommand dependency property.
public static readonly BindableProperty SwipeCompletedCommandProperty
SwipeStartingCommandProperty
BindableProperty
Identifies the SwipeStartingCommand dependency property.
public static readonly BindableProperty SwipeStartingCommandProperty
SwipeThresholdProperty
BindableProperty
Identifies the SwipeThreshold dependency property.
public static readonly BindableProperty SwipeThresholdProperty
SwipingCommandProperty
BindableProperty
Identifies the SwipingCommand dependency property.
public static readonly BindableProperty SwipingCommandProperty
VerticalScrollBarVisibilityProperty
BindableProperty
Identifies the VerticalScrollBarVisibility bindable property.
public static readonly BindableProperty VerticalScrollBarVisibilityProperty
Properties
Gets or sets a value indicating whether groups in the control are automatically expanded.
public bool AutoExpandGroups { get; set; }
AutomaticLoadOnDemandTemplate
DataTemplate
Gets or sets the DataTemplate that defines the visual representation of the loading indicator in Automatic mode. This template is used to create the loading indicator shown while data is being loaded automatically.
public DataTemplate AutomaticLoadOnDemandTemplate { get; set; }
Gets or sets the current item in the collection view for keyboard navigation purposes. This is primarily used on desktop platforms to track which item has keyboard focus. The current item is visually highlighted and can be navigated using arrow keys.
public object CurrentItem { get; set; }
Gets or sets the path to a property on the source object that will be used as the visual representation of the item. When ItemTemplate is not specified, this property path will be used to display text for each item.
public string DisplayMemberPath { get; set; }
Gets or sets the custom behavior that controls drag and drop operations for collection view items. This behavior allows you to override the default drag and drop logic with custom handling for drag validation, drop positioning, and data manipulation.
public CollectionViewDragDropBehavior DragDropBehavior { get; set; }
DragVisualTemplate
DataTemplate
Gets or sets the DataTemplate that defines the visual representation of an item while it is being dragged. This template determines how the dragged item appears as it follows the user's finger or cursor during the drag operation.
public DataTemplate DragVisualTemplate { get; set; }
DropIndicatorTemplate
DataTemplate
Gets or sets the DataTemplate that defines the visual appearance of the drop indicator. The drop indicator is shown between items during drag and drop operations to indicate where the dragged item will be placed.
public DataTemplate DropIndicatorTemplate { get; set; }
Gets or sets a value that determines when the EmptyContentTemplate will be displayed. Options include showing when ItemsSource is null, or when it's null or empty.
public EmptyContentDisplayMode EmptyContentDisplayMode { get; set; }
EmptyContentTemplate
DataTemplate
Gets or sets the DataTemplate that defines the content displayed when the collection view has no items to show. The visibility is controlled by the EmptyContentDisplayMode property.
public DataTemplate EmptyContentTemplate { get; set; }
Gets or sets a value indicating whether group headers remain fixed (sticky) at the top of the collection view while scrolling through group content. This feature is supported on iOS and Android platforms only.
public bool EnableStickyGroupHeaders { get; set; }
Gets the command that can be used to programmatically close any currently swiped item and return it to its normal position. This command is useful for closing swipe views from external code or user interface elements. When you execute this command you need to pass a bool parameter, and its value should be true if you want the view to be moved back to its normal position with an animation.
public ICommand EndItemSwipeCommand { get; }
Gets or sets the width that a swiped item retains when swiped from the end edge (right in LTR, left in RTL). This determines how much of the end swipe template remains visible after the swipe completes.
public double EndSwipeLength { get; set; }
EndSwipeTemplate
DataTemplate
Gets or sets the DataTemplate that defines the visual content displayed when an item is swiped from the end edge. In vertical orientation, this appears when swiping right; in horizontal orientation, when swiping down.
public DataTemplate EndSwipeTemplate { get; set; }
Gets the collection of FilterDescriptorBase objects that define the filtering criteria for the collection view. All filter descriptors are applied simultaneously to determine which items are visible.
public FilterDescriptorCollection FilterDescriptors { get; }
FooterTemplate
DataTemplate
Gets or sets the DataTemplate that will be displayed at the end of the collection view content. This footer appears after all items and groups in the scrollable area.
public DataTemplate FooterTemplate { get; set; }
Gets the collection of GroupDescriptorBase objects that define the grouping criteria for the collection view. Multiple group descriptors create a hierarchical grouping structure with multiple group levels.
public GroupDescriptorCollection GroupDescriptors { get; }
GroupHeaderTemplate
DataTemplate
Gets or sets the DataTemplate that defines the visual representation of group headers. Can be a DataTemplate or DataTemplateSelector for custom template selection logic. Only applicable when grouping is enabled via GroupDescriptors.
public DataTemplate GroupHeaderTemplate { get; set; }
Gets or sets the command that is executed when a group header is tapped. The command parameter is the GroupContext of the tapped group header.
public ICommand GroupTapCommand { get; set; }
GroupViewStyle
Style
Gets or sets the Style that is applied to the container element generated for each group header. This style is applied to RadCollectionViewGroupView instances.
public Style GroupViewStyle { get; set; }
Gets or sets the style selector that provides custom style-selection logic for group header container elements. Allows applying different styles to different group headers based on their group context or other criteria.
public IStyleSelector GroupViewStyleSelector { get; set; }
HeaderTemplate
DataTemplate
Gets or sets the DataTemplate that will be displayed at the beginning of the collection view content. This header appears before all items and groups in the scrollable area.
public DataTemplate HeaderTemplate { get; set; }
HorizontalScrollBarVisibility
ScrollBarVisibility
Gets or sets the visibility of the horizontal scroll bar. Controls when the horizontal scroll indicator is shown during scrolling.
public ScrollBarVisibility HorizontalScrollBarVisibility { get; set; }
Gets or sets a value indicating whether drag and drop functionality is enabled for collection view items. When enabled, users can drag items to reorder them within the collection or move them to other drop targets.
public bool IsDragDropEnabled { get; set; }
Gets or sets a value indicating whether items in the collection view can be swiped to reveal additional content or actions. When enabled, users can swipe items left or right to access swipe templates.
public bool IsItemSwipeEnabled { get; set; }
Gets or sets a value indicating whether an asynchronous load-on-demand operation is currently in progress. This property is automatically managed when using LoadOnDemandCollection<T>. When handling LoadOnDemand event or LoadOnDemandCommand manually, set this to true before starting async operations and false after completing them to prevent multiple concurrent requests.
public bool IsLoadOnDemandActive { get; set; }
Gets or sets a value indicating whether the load-on-demand feature is enabled. When enabled, the collection view can automatically or manually trigger loading of additional items as the user scrolls or interacts with the control. Use the LoadOnDemand event or LoadOnDemandCommand to handle loading requests, or use LoadOnDemandCollection<T> as ItemsSource.
public bool IsLoadOnDemandEnabled { get; set; }
Gets or sets the command that is executed when a collection view item is held. The command parameter is the data context of the held item.
public ICommand ItemHoldCommand { get; set; }
Gets or sets the layout strategy that defines how items are arranged and displayed in the collection view. Supports linear layouts (CollectionViewLinearLayout) and grid layouts (CollectionViewGridLayout).
public CollectionViewLayoutBase ItemsLayout { get; set; }
Gets or sets the data source used to generate the content of the collection view. This can be any object that implements IEnumerable, such as a list, array, or observable collection.
public object ItemsSource { get; set; }
Gets or sets the command that is executed when a collection view item is tapped. The command parameter is the data context of the tapped item.
public ICommand ItemTapCommand { get; set; }
ItemTemplate
DataTemplate
Gets or sets the DataTemplate that defines the visual representation of items in the collection view. Can be a DataTemplate or DataTemplateSelector for custom template selection logic.
public DataTemplate ItemTemplate { get; set; }
ItemViewStyle
Style
Gets or sets the Style that is applied to the container element generated for each item. This style is applied to RadCollectionViewItemView instances.
public Style ItemViewStyle { get; set; }
Gets or sets the style selector that provides custom style-selection logic for item container elements. Allows applying different styles to different items based on their data context or other criteria.
public IStyleSelector ItemViewStyleSelector { get; set; }
Gets or sets the number of items before the end of the current data that will trigger automatic load-on-demand. This property only applies when LoadOnDemandMode is set to Automatic. A larger value will trigger loading earlier as the user scrolls towards the end.
public int LoadOnDemandBufferItemsCount { get; set; }
Gets or sets the command that is executed when a load-on-demand operation is triggered. In Manual mode, this command is executed when the user clicks the load more button. In Automatic mode, this command is executed when the user scrolls near the end of the current items.
public ICommand LoadOnDemandCommand { get; set; }
Gets or sets the mode that determines how load-on-demand operations are triggered. Manual mode displays a clickable button, while Automatic mode triggers loading based on scroll position.
public LoadOnDemandMode LoadOnDemandMode { get; set; }
ManualLoadOnDemandTemplate
DataTemplate
Gets or sets the DataTemplate that defines the visual representation of the load-on-demand control in Manual mode. This template is used to create the button or control that users click to load more items.
public DataTemplate ManualLoadOnDemandTemplate { get; set; }
Gets or sets the zero-based index of the currently selected item. Returns -1 when no item is selected. In multiple selection mode, returns the index of the first item in the SelectedItems collection.
public int SelectedIndex { get; set; }
Gets or sets the currently selected item from the data source. Returns null when no item is selected. In multiple selection mode, returns the first item in the SelectedItems collection.
public object SelectedItem { get; set; }
Gets the collection of currently selected items from the data source. This collection is automatically updated when the selection changes and supports notifications.
public ObservableCollection<object> SelectedItems { get; }
Gets or sets the gesture type that triggers selection in the collection view. Options include Tap (selection on tap) or Hold (selection on long press).
public CollectionViewSelectionGesture SelectionGesture { get; set; }
Gets or sets the selection mode that determines how items can be selected in the collection view. Options include None (no selection), Single (one item), or Multiple (multiple items).
public CollectionViewSelectionMode SelectionMode { get; set; }
Gets the collection of SortDescriptorBase objects that define the sorting criteria for the collection view. Multiple sort descriptors create a multi-level sorting operation where subsequent descriptors are used as tie-breakers.
public SortDescriptorCollection SortDescriptors { get; }
Gets or sets the width that a swiped item retains when swiped from the start edge (left in LTR, right in RTL). This determines how much of the start swipe template remains visible after the swipe completes.
public double StartSwipeLength { get; set; }
StartSwipeTemplate
DataTemplate
Gets or sets the DataTemplate that defines the visual content displayed when an item is swiped from the start edge. In vertical orientation, this appears when swiping left; in horizontal orientation, when swiping up.
public DataTemplate StartSwipeTemplate { get; set; }
Gets or sets the command that is executed when an item swipe gesture has been completed. This is called after the user has finished the swipe gesture and the final state has been determined. The parameter of this command is of type CollectionViewSwipeCompletedCommandContext.
public ICommand SwipeCompletedCommand { get; set; }
Gets or sets the command that is executed when an item swipe gesture is about to begin. This provides an opportunity to perform custom logic or cancel the swipe operation. The parameter of this command is of type CollectionViewSwipeStartingCommandContext.
public ICommand SwipeStartingCommand { get; set; }
Gets or sets the minimum distance (in pixels) that a user must swipe to trigger the swipe feature. A smaller threshold makes swipes more sensitive, while a larger threshold requires more deliberate gestures.
public double SwipeThreshold { get; set; }
Gets or sets the command that is executed continuously while an item is being swiped. This provides real-time feedback during the swipe gesture. The parameter of this command is of type CollectionViewSwipingCommandContext.
public ICommand SwipingCommand { get; set; }
VerticalScrollBarVisibility
ScrollBarVisibility
Gets or sets the visibility of the vertical scroll bar. Controls when the vertical scroll indicator is shown during scrolling.
public ScrollBarVisibility VerticalScrollBarVisibility { get; set; }
Methods
Programmatically closes any currently swiped item and returns it to its normal position. This method provides direct control over the swipe state without requiring user interaction.
public void EndItemSwipe(bool animate = true, Action animationFinished = null)
If true, the closing operation will be animated; otherwise, it will be immediate. Default is true.
An optional callback that is invoked when the closing animation completes. Only applicable when animate is true.
Gets an IDataViewCollection instance that provides access to the processed data after all sorting, grouping, and filtering operations have been applied. This allows you to traverse and manipulate the data as it appears in the collection view.
public IDataViewCollection GetDataView()
An IDataViewCollection representing the current data view state.
Invoked whenever the binding context of the control changes.
protected override void OnBindingContextChanged()
protected override void OnHandlerChanged()
protected override void OnPropertyChanged(string propertyName = null)
Scrolls the collection view to bring the specified data item into the visible area. If the item is not currently loaded due to data virtualization, this method will attempt to locate and scroll to it.
public void ScrollItemIntoView(object item, bool animate = true)
The data item to scroll to. This should be an item from the ItemsSource.
animateboolIf true, the scroll operation will be animated; otherwise, it will be immediate. Default is true.
Events
GroupTapped
EventHandler<RadTappedEventArgs<GroupContext>>
Occurs when a user taps on a group header. The event provides the group context that was tapped.
public event EventHandler<RadTappedEventArgs<GroupContext>> GroupTapped
GroupTapping
EventHandler<RadTappingEventArgs<GroupContext>>
Occurs when a user is in the process of tapping on a group header. This event is raised before the GroupTapped event and can be cancelled.
public event EventHandler<RadTappingEventArgs<GroupContext>> GroupTapping
Occurs when a user performs a hold gesture on a collection view item. The event provides the held item's data context through CollectionViewItemHoldEventArgs.
public event EventHandler<CollectionViewItemHoldEventArgs> ItemHold
ItemTapped
EventHandler<RadTappedEventArgs<object>>
Occurs when a user taps on a collection view item. The event provides the tapped item's data context.
public event EventHandler<RadTappedEventArgs<object>> ItemTapped
Occurs when additional items need to be loaded into the collection view. In Manual mode, this event is raised when the user taps the load more button. In Automatic mode, this event is raised when the user scrolls near the end of the current items. Use LoadOnDemandCollection<T> as ItemsSource for automatic loading indicators, or manually handle this event by setting IsLoadOnDemandActive to true before async operations and false after adding new items to the ItemsSource.
public event EventHandler<EventArgs> LoadOnDemand
Scrolled
EventHandler<ScrolledEventArgs>
Occurs when the collection view is scrolled. Provides information about the scroll position and offset.
public event EventHandler<ScrolledEventArgs> Scrolled
SelectionChanged
EventHandler<RadSelectionChangedEventArgs>
Occurs when the selection in the collection view changes. Provides information about added and removed items from the selection.
public event EventHandler<RadSelectionChangedEventArgs> SelectionChanged
Occurs when an item swipe gesture has been completed. This event is raised after the user has finished the swipe gesture and provides the final swipe state.
public event EventHandler<CollectionViewSwipeCompletedEventArgs> SwipeCompleted
Occurs when an item swipe gesture is about to begin. This event provides an opportunity to cancel the swipe operation before it starts.
public event EventHandler<CollectionViewSwipeStartingEventArgs> SwipeStarting
Occurs while an item is being swiped. This event is raised continuously during the swipe gesture and provides real-time swipe information.
public event EventHandler<CollectionViewSwipingEventArgs> Swiping