Skip to main content
All docs
V21.2

SnapControl.DataSource Property

Specifies the SnapControl data source.

Namespace: DevExpress.Snap

Assembly: DevExpress.Snap.v21.2.dll

NuGet Package: DevExpress.Win.Snap

Declaration

[DefaultValue(null)]
[DXCategory("Data")]
public object DataSource { get; set; }

Property Value

Type Default Description
Object null

A Object value, specifying the document data source.

Remarks

The data binding in Snap can be accomplished by creating a data source of one of the following types.

  • Application Data Source

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

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

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

  • Document Data Source

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

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

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

An application data source is given 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 DataSource 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