alexa
Syncfusion
menu Syncfusion

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class DataSource

    Inheritance
    object
    DataSource
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Maui.DataSource
    Assembly: Syncfusion.Maui.DataSource.dll
    Syntax
    public class DataSource : IDisposable

    Constructors

    DataSource()

    Initializes a new instance of the DataSource class.

    Declaration
    public DataSource()

    Fields

    editItem

    Store the object for editing and commit the value to underlying source after editing completed.

    Declaration
    protected object editItem
    Field Value
    Type
    object

    isInCommitEdit

    Commits the edited object to the underlying source

    Declaration
    protected bool isInCommitEdit
    Field Value
    Type
    bool

    isInEndeferal

    Notify to wire and unwire the property changed event whenever the underlying collection changed.

    Declaration
    protected bool isInEndeferal
    Field Value
    Type
    bool

    Properties

    AutoExpandGroups

    Gets or sets a value indicating whether groups has to expand automatically or not.

    Declaration
    public bool AutoExpandGroups { get; set; }
    Property Value
    Type
    bool

    CanAddNew

    Gets a value indicating whether new object can be added or not

    Declaration
    public virtual bool CanAddNew { get; }
    Property Value
    Type
    bool

    CanCancelEdit

    Gets a value indicating whether editing can be cancelled or not

    Declaration
    public bool CanCancelEdit { get; }
    Property Value
    Type
    bool

    CanRemove

    Gets a value indicating whether object can be removed from source

    Declaration
    public bool CanRemove { get; }
    Property Value
    Type
    bool

    CurrentAddItem

    Gets or sets the currently added item.

    Declaration
    public object CurrentAddItem { get; set; }
    Property Value
    Type
    object

    CurrentEditItem

    Gets current editing item

    Declaration
    public object CurrentEditItem { get; }
    Property Value
    Type
    object

    DisplayItems

    Gets the list of items to be displayed

    Declaration
    public DisplayItems DisplayItems { get; }
    Property Value
    Type Description
    DisplayItems

    The display items.

    Filter

    Gets or sets the filter for the underlying collection

    Declaration
    public Predicate<object> Filter { get; set; }
    Property Value
    Type
    Predicate<object>

    FilterPredicates

    Gets or sets the filter predicates.

    Declaration
    public ObservableCollection<IFilterDefinition> FilterPredicates { get; set; }
    Property Value
    Type
    ObservableCollection<IFilterDefinition>

    GroupComparer

    Gets or sets the GroupComparer.This will be considered when comparer in GroupDescriptor is null.

    Declaration
    public IComparer<GroupResult> GroupComparer { get; set; }
    Property Value
    Type Description
    IComparer<GroupResult>

    IComparer of GroupResult.

    GroupDescriptors

    Gets the collection of group descriptors.

    Declaration
    public ObservableCollection<GroupDescriptor> GroupDescriptors { get; }
    Property Value
    Type Description
    ObservableCollection<GroupDescriptor>

    The group descriptor.

    Groups

    Gets the list of groups

    Declaration
    public GroupList Groups { get; }
    Property Value
    Type Description
    GroupList

    The Group List.

    IsAddingNew

    Gets a value indicating whether adding new object or not

    Declaration
    public bool IsAddingNew { get; }
    Property Value
    Type
    bool

    IsDynamicBound

    Gets or sets a value indicating whether this instance is dynamic bound.

    Declaration
    public bool IsDynamicBound { get; set; }
    Property Value
    Type Description
    bool

    true if this instance is dynamic bound; otherwise, false.

    IsEditingItem

    Gets a value indicating whether is in editing or not

    Declaration
    public bool IsEditingItem { get; }
    Property Value
    Type
    bool

    Items

    Gets the list of items. Contains filtered data

    Declaration
    public IList<object> Items { get; }
    Property Value
    Type Description
    IList<object>

    The List of items.

    LiveDataUpdateMode

    Gets or sets the live data update mode of the DataSource.

    Declaration
    public LiveDataUpdateMode LiveDataUpdateMode { get; set; }
    Property Value
    Type Description
    LiveDataUpdateMode

    The live data update mode.

    SortComparer

    Gets or sets the SortComparer.This will be considered when comparer in SortDescriptor is null.

    Declaration
    public IComparer<object> SortComparer { get; set; }
    Property Value
    Type Description
    IComparer<object>

    IComparer of object.

    SortDescriptors

    Gets the collection of sort descriptors.

    Declaration
    public ObservableCollection<SortDescriptor> SortDescriptors { get; }
    Property Value
    Type Description
    ObservableCollection<SortDescriptor>

    The collection of sort descriptor.

    Source

    Gets or sets the Source of the DataSource.

    Declaration
    public IEnumerable Source { get; set; }
    Property Value
    Type Description
    IEnumerable

    The source.

    SourceType

    Gets or sets the source type of the underlying source

    Declaration
    public Type SourceType { get; set; }
    Property Value
    Type
    Type

    Methods

    AddNew()

    Adds the new object of source type to source

    Declaration
    [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
    [UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.", Justification = "<Pending>")]
    public virtual object AddNew()
    Returns
    Type Description
    object

    The object added object

    BeginInit()

    Suspend the events and initiate changes

    Declaration
    public void BeginInit()

    CancelEdit()

    Cancel the the editing

    Declaration
    public void CancelEdit()

    CancelNew()

    Removes the added item

    Declaration
    public virtual void CancelNew()

    CommitEdit()

    Commit the editing of object.

    Declaration
    public virtual void CommitEdit()

    CommitNew()

    Commits the newly added object to source

    Declaration
    public virtual void CommitNew()

    DeferRefresh()

    Refresh the DataSource and halt

    Declaration
    public IDisposable DeferRefresh()
    Returns
    Type Description
    IDisposable

    Represents the IDispose.

    Dispose()

    Disposes all available resources.

    Declaration
    public void Dispose()

    Dispose(bool)

    Dispose the instances, if parameter is true.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    Represents the boolean value for disposing objects

    EditItem(object)

    Initiates the editing of an item

    Declaration
    public void EditItem(object item)
    Parameters
    Type Name Description
    object item

    Item to edit

    EndEdit()

    End the editing of object

    Declaration
    public virtual void EndEdit()

    EndInit()

    End Suspending events and changes and deferRefresh the DataSource.

    Declaration
    public void EndInit()

    GetActiveComparer()

    Helper method to get the active comparer object.

    Declaration
    protected IComparer<object> GetActiveComparer()
    Returns
    Type Description
    IComparer<object>

    Returns the comparer object.

    GetItemAt(int)

    Returns the item in the index

    Declaration
    public virtual object GetItemAt(int index)
    Parameters
    Type Name Description
    int index

    The index of the item

    Returns
    Type Description
    object

    Returns the item in the index.

    GetSourceListCollection()

    Returns the IList of source.

    Declaration
    protected IList GetSourceListCollection()
    Returns
    Type Description
    IList

    Returns the IList.

    GetValue(object, string)

    Gets the value of property from the given object

    Declaration
    [RequiresUnreferencedCode("The GetValue is not trim compatible")]
    [UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.", Justification = "<Pending>")]
    protected virtual object GetValue(object item, string propertyName)
    Parameters
    Type Name Description
    object item

    The object

    string propertyName

    Property name

    Returns
    Type Description
    object

    The value

    NotifyPropertyChangedHandler(object, PropertyChangedEventArgs)

    Handles the source property change

    Declaration
    protected virtual void NotifyPropertyChangedHandler(object sender, PropertyChangedEventArgs e)
    Parameters
    Type Name Description
    object sender

    The object.

    PropertyChangedEventArgs e

    Represents the PropertyChangedEventArgs

    Refresh()

    Refreshes the DataSource

    Declaration
    [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
    [UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.", Justification = "<Pending>")]
    public void Refresh()

    RefreshFilter()

    Refresh the DataSource. Raises the FilterChanged Event

    Declaration
    [RequiresUnreferencedCode("The RefreshFilter is not trim compatible")]
    [RequiresDynamicCode("This method relies on dynamic code generation.")]
    public virtual void RefreshFilter()

    SetActiveComparer()

    Helper method to initialize the comparer object.

    Declaration
    [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
    protected void SetActiveComparer()

    Events

    FilterChanged

    Occurs when filter changed

    Declaration
    public event NotifyCollectionChangedEventHandler FilterChanged
    Event Type
    Type
    NotifyCollectionChangedEventHandler

    SourceCollectionChanged

    Occurs when source collection changed

    Declaration
    public event NotifyCollectionChangedEventHandler SourceCollectionChanged
    Event Type
    Type
    NotifyCollectionChangedEventHandler

    SourcePropertyChanged

    Occurs when source property Changed

    Declaration
    public event PropertyChangedEventHandler SourcePropertyChanged
    Event Type
    Type
    PropertyChangedEventHandler

    Implements

    IDisposable

    Extension Methods

    QueryableCollectionViewExtensions.GetPredicateExpressionExt(DataSource, IQueryable, out ParameterExpression)
    QueryableCollectionViewExtensions.GetPredicateExpressionExt(DataSource, IQueryable, out ParameterExpression, string, bool)
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved