Skip to main content
All docs
V21.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SnapDocument.DataSources Property

Provides access to the collection of a document’s data sources.

Namespace: DevExpress.Snap.Core.API

Assembly: DevExpress.Snap.v21.2.Core.dll

NuGet Package: DevExpress.Snap.Core

#Declaration

DataSourceInfoCollection DataSources { get; }

#Property Value

Type Description
DataSourceInfoCollection

A DataSourceInfoCollection object, specifying the collection of the data sources.

#Remarks

You can use two types of data sources bind SnapControl to data:

  • Application Data Source

    A data source that is assigned to the SnapControl.DataSource property cannot be edited or removed from inside the Snap application and is always available for any document opened in it.

    Use the SnapControl.DataSources property to access the control’s data sources collection.

    A calculated field added to an application data source has no access to fields from document data sources.

  • Document Data Source

    A data source that is specified from the user interface is assigned to the IDataSourceOwner.DataSource property of a currently opened SnapDocument.

    To access the collection of a SnapDocument‘s data sources, use the DataSources property.

    A calculated field added to a document data source can evaluate the field values that belong to the application data sources.

An application data source has a priority when it has a name identical to a document data source.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DataSources property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also