menu

Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridSelectionController - Xamarin.Forms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class GridSelectionController

    Represents a class that implements IGridSelectionController that contains methods through IGridSelectionController for handling selection operations in a SfDataGrid control.

    Inheritance
    System.Object
    GridSelectionControllerBase
    GridSelectionController
    Implements
    IGridSelectionController
    System.IDisposable
    Inherited Members
    GridSelectionControllerBase.DataGrid
    GridSelectionControllerBase.Dispose()
    GridSelectionControllerBase.ProcessKeyDown(String, Boolean, Boolean)
    GridSelectionControllerBase.RaiseSelectionChanged(List<Object>, List<Object>)
    GridSelectionControllerBase.RaiseSelectionChanging(List<Object>, List<Object>)
    GridSelectionControllerBase.ResumeUpdates()
    GridSelectionControllerBase.SelectedRows
    GridSelectionControllerBase.SuspendUpdates()
    Namespace: Syncfusion.SfDataGrid.XForms
    Assembly: Syncfusion.SfDataGrid.XForms.dll
    Syntax
    public class GridSelectionController : GridSelectionControllerBase, IGridSelectionController, IDisposable

    Constructors

    GridSelectionController(SfDataGrid)

    Initializes a new instance of the GridSelectionController class.

    Declaration
    public GridSelectionController(SfDataGrid dataGrid)
    Parameters
    Type Name Description
    SfDataGrid dataGrid

    The reference of the SfDataGrid.

    Properties

    LastSelectedRowIndex

    Gets or sets the last selected row index.

    Declaration
    protected int LastSelectedRowIndex { get; set; }
    Property Value
    Type Description
    System.Int32

    The row index of the last selected row.

    Methods

    ClearSelection()

    Clears the selection in a SfDataGrid control.

    Declaration
    public void ClearSelection()

    Dispose(Boolean)

    Releases the unmanaged resources used by the component and optionally releases the managed resources.

    Declaration
    protected override void Dispose(bool isDisposing)
    Parameters
    Type Name Description
    System.Boolean isDisposing

    if true - release both managed and unmanaged resources; if false - release only unmanaged resources.

    Overrides
    GridSelectionControllerBase.Dispose(Boolean)
    Remarks

    Application developers can override this to get notified of dispose call and dispose the required objects here.

    GetSelectionColor(Int32, Object)

    Returns the selection color for selected row. This method can be overridden to apply multiple selection color.

    Declaration
    public virtual Color GetSelectionColor(int rowIndex, object rowData)
    Parameters
    Type Name Description
    System.Int32 rowIndex

    The index of the selected row.

    System.Object rowData

    The row data of the selected row.

    Returns
    Type Description
    Xamarin.Forms.Color

    The selection color for selected row.

    HandleCollectionChanged(NotifyCollectionChangedEventArgs, CollectionChangedReason)

    Handles the collection changes such as selected items and source collection changed to process selection.

    Declaration
    public virtual void HandleCollectionChanged(NotifyCollectionChangedEventArgs e, CollectionChangedReason reason)
    Parameters
    Type Name Description
    System.Collections.Specialized.NotifyCollectionChangedEventArgs e

    The System.Collections.Specialized.NotifyCollectionChangedEventArgs.

    Syncfusion.SfDataGrid.XForms.CollectionChangedReason reason

    The reason for the collection change.

    HandleGridOperation(GridOperationHandlerArgs)

    Handles the grid operation to update selection.

    Declaration
    public virtual void HandleGridOperation(GridOperationHandlerArgs args)
    Parameters
    Type Name Description
    GridOperationHandlerArgs args

    The GridOperationHandlerArgs.

    HandlePointerOperation(GridPointerEventArgs, RowColumnIndex)

    Handles the pointer operation (touch-up or double tap) to handle selection.

    Declaration
    public virtual void HandlePointerOperation(GridPointerEventArgs args, RowColumnIndex rowColumnIndex)
    Parameters
    Type Name Description
    GridPointerEventArgs args

    The GridPointerEventArgs.

    RowColumnIndex rowColumnIndex

    The row column index in which the pointer operation is performed.

    HandleSelectionPropertyChanges(SelectionPropertyChangedHandlerArgs)

    Handles the selection when the selection related properties gets changed.

    Declaration
    public virtual void HandleSelectionPropertyChanges(SelectionPropertyChangedHandlerArgs args)
    Parameters
    Type Name Description
    SelectionPropertyChangedHandlerArgs args

    The SelectionPropertyChangedHandlerArgs.

    ProcessCurrentItemChanged(SelectionPropertyChangedHandlerArgs)

    Processes the CurrentItem changes in a SfDataGrid control.

    Declaration
    protected override void ProcessCurrentItemChanged(SelectionPropertyChangedHandlerArgs args)
    Parameters
    Type Name Description
    SelectionPropertyChangedHandlerArgs args

    SelectionPropertyChangedHandler arguments.

    Overrides
    GridSelectionControllerBase.ProcessCurrentItemChanged(SelectionPropertyChangedHandlerArgs)
    Remarks

    When SelectionMode is Multiple the last selected item is stored in the CurrentItem.

    ProcessingPointerTouchUp(RowColumnIndex)

    Method to process the pointer touch up. Handles the touch up operation of each row in a SfDataGrid control.

    Declaration
    public virtual void ProcessingPointerTouchUp(RowColumnIndex rowColumnIndex)
    Parameters
    Type Name Description
    RowColumnIndex rowColumnIndex

    The row column index in which the touch up action is performed.

    ProcessNavigationModeChanged(SelectionPropertyChangedHandlerArgs)

    Processes the NavigationMode changes in a SfDataGrid control.

    Declaration
    protected virtual void ProcessNavigationModeChanged(SelectionPropertyChangedHandlerArgs args)
    Parameters
    Type Name Description
    SelectionPropertyChangedHandlerArgs args

    The SelectionPropertyChangedHandlerArgs.

    Remarks

    When navigation mode is changed from cell to row clears all selection.

    ProcessOnGroupChanged(GridGroupingEventArgs)

    Processes selection when the grouping is changed in a SfDataGrid control.

    Declaration
    protected override void ProcessOnGroupChanged(GridGroupingEventArgs args)
    Parameters
    Type Name Description
    GridGroupingEventArgs args

    The GridGroupingEventArgs.

    Overrides
    GridSelectionControllerBase.ProcessOnGroupChanged(GridGroupingEventArgs)

    ProcessOnSortChanged(SortColumnChangedHandleArgs)

    Processes selection when the sorting is changed in a SfDataGrid control.

    Declaration
    protected override void ProcessOnSortChanged(SortColumnChangedHandleArgs sortColumnHandleArgs)
    Parameters
    Type Name Description
    SortColumnChangedHandleArgs sortColumnHandleArgs

    The SortColumnChangedHandleArgs.

    Overrides
    GridSelectionControllerBase.ProcessOnSortChanged(SortColumnChangedHandleArgs)

    ProcessSelectedIndexChanged(SelectionPropertyChangedHandlerArgs)

    Processes the SelectedIndex changes in a SfDataGrid control.

    Declaration
    protected override void ProcessSelectedIndexChanged(SelectionPropertyChangedHandlerArgs args)
    Parameters
    Type Name Description
    SelectionPropertyChangedHandlerArgs args

    The SelectionPropertyChangedHandlerArgs.

    Overrides
    GridSelectionControllerBase.ProcessSelectedIndexChanged(SelectionPropertyChangedHandlerArgs)
    Remarks

    When SelectionMode is Multiple the index of the first selected item is stored in the SelectedIndex.

    ProcessSelectedItemChanged(SelectionPropertyChangedHandlerArgs)

    Processes the SelectedItem changes in a SfDataGrid control.

    Declaration
    protected override void ProcessSelectedItemChanged(SelectionPropertyChangedHandlerArgs args)
    Parameters
    Type Name Description
    SelectionPropertyChangedHandlerArgs args

    The SelectionPropertyChangedHandlerArgs.

    Overrides
    GridSelectionControllerBase.ProcessSelectedItemChanged(SelectionPropertyChangedHandlerArgs)

    ProcessSelectedItemsChanged(NotifyCollectionChangedEventArgs)

    Processes the SelectedItems collection changed to update the selection.

    Declaration
    public virtual void ProcessSelectedItemsChanged(NotifyCollectionChangedEventArgs e)
    Parameters
    Type Name Description
    System.Collections.Specialized.NotifyCollectionChangedEventArgs e

    The System.Collections.Specialized.NotifyCollectionChangedEventArgs.

    ProcessSelectionModeChanged(SelectionPropertyChangedHandlerArgs)

    Processes the SelectionMode changes in a SfDataGrid control.

    Declaration
    protected override void ProcessSelectionModeChanged(SelectionPropertyChangedHandlerArgs args)
    Parameters
    Type Name Description
    SelectionPropertyChangedHandlerArgs args

    The SelectionPropertyChangedHandlerArgs.

    Overrides
    GridSelectionControllerBase.ProcessSelectionModeChanged(SelectionPropertyChangedHandlerArgs)
    Remarks

    When selection mode is changed from multiple to single/singleDeselect clears all the selection expect last selection.

    ProcessSourceCollectionChanged(NotifyCollectionChangedEventArgs, CollectionChangedReason)

    Processes the source collection changes to update selection in a SfDataGrid control.

    Declaration
    protected override void ProcessSourceCollectionChanged(NotifyCollectionChangedEventArgs e, CollectionChangedReason reason)
    Parameters
    Type Name Description
    System.Collections.Specialized.NotifyCollectionChangedEventArgs e

    NotifyCollectionChangedEvent arguments.

    Syncfusion.SfDataGrid.XForms.CollectionChangedReason reason

    CollectionChanged reason.

    Overrides
    GridSelectionControllerBase.ProcessSourceCollectionChanged(NotifyCollectionChangedEventArgs, CollectionChangedReason)

    RefreshSelection()

    Refreshes the selections and sets values for the SelectedIndex, SelectedItem, CurrentItem and SelectedItems properties.

    Declaration
    public void RefreshSelection()

    ResetSelection()

    Resets the selected index for the rows in SelectedRows collection.

    Declaration
    public void ResetSelection()

    SetSelectionAnimation(VirtualizingCellsControl)

    Sets animation for the selected row.

    Declaration
    protected virtual void SetSelectionAnimation(VirtualizingCellsControl rowElement)
    Parameters
    Type Name Description
    VirtualizingCellsControl rowElement

    The view which holds the row data of the selected row.

    Implements

    IGridSelectionController
    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved