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.v20.1.dll


public virtual object DataSource { get; set; }
Public Overridable Property DataSource As Object

Property Value

Type Default Description


The object used as the data source.


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.

See Also