Skip to main content

DataLayoutControl.DataSource Property

Gets or sets the data source providing data for editors that are created by the DataLayoutControl control.

Namespace: DevExpress.XtraDataLayout

Assembly: DevExpress.XtraLayout.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

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

Property Value

Type Default Description
Object null

The object used as the data source.

Remarks

The DataLayoutControl allows you to connect to a specific data source, create editors bound to the data source’s fields and add the editors to the layout. The DataSource and DataLayoutControl.DataMember properties refer to the target data source.

At design time, use the DataLayoutControl‘s wizard to bind to the data source and create editors. At runtime, you can specify the data source manually via the DataSource and DataLayoutControl.DataMember properties and then call the DataLayoutControl.RetrieveFields method, which will create editors for all fields in the bound data source. Instead of manually calling the DataLayoutControl.RetrieveFields method, you can enable the DataLayoutControl.AutoRetrieveFields option. In this case, a layout will be re-built each time a new value is assigned to the DataSource property.

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