Skip to main content
A newer version of this page is available. .

ObjectDataSource.Constructor Property

Specifies an object that enables an ObjectDataSource to access constructor parameters.

Namespace: DevExpress.DataAccess.ObjectBinding

Assembly: DevExpress.DataAccess.v18.2.dll

Declaration

[DefaultValue(null)]
public ObjectConstructorInfo Constructor { get; set; }

Property Value

Type Default Description
ObjectConstructorInfo *null*

An ObjectConstructorInfo value.

Remarks

If it is required that on calling the ObjectDataSource.Fill method, an ObjectDataSource should create an instance of the type specified by its ObjectDataSource.DataSource property, use the Constructor property to specify the required constructor parameters. To assign a constructor without parameters, use the static ObjectConstructorInfo.Default object.

For a code sample, see the following example online: How to programmatically generate ObjectDataSource and map object data source constructor parameters to report parameters.

Set this property to null for the ObjectDataSource to never try to create an object instance (if you need to manually create and assign it, or when binding to a static member).

The following code snippets (auto-collected from DevExpress Examples) contain references to the Constructor 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