The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

IObjectDataSourceValidationService.Validate(IEnumerable<ObjectDataSource>) Method

Validates the ObjectDataSource data objects before data retrieval.

Namespace: DevExpress.XtraSpreadsheet.Services

Assembly: DevExpress.Spreadsheet.v19.2.Core.dll

Declaration

void Validate(
    IEnumerable<ObjectDataSource> dataSources
)
Sub Validate(
    dataSources As IEnumerable(Of ObjectDataSource)
)
void Validate(
    IEnumerable<ObjectDataSource> dataSources
)
Sub Validate(
    dataSources As IEnumerable(Of ObjectDataSource)
)
void Validate(
    IEnumerable<ObjectDataSource> dataSources
)
Sub Validate(
    dataSources As IEnumerable(Of ObjectDataSource)
)

Parameters

Name Type Description
dataSources IEnumerable<ObjectDataSource>

An IEnumerable<T><ObjectDataSource,> collection to validate.

Parameters

Name Type Description
dataSources IEnumerable<ObjectDataSource>

An IEnumerable<T><ObjectDataSource,> collection to validate.

Parameters

Name Type Description
dataSources IEnumerable<ObjectDataSource>

An IEnumerable<T><ObjectDataSource,> collection to validate.

Remarks

To prevent a data object in a collection from executing its data retrieval method, set its ObjectDataSource.DataSource and ObjectDataSource.DataMember properties to null.

Examples

using DevExpress.DataAccess.ObjectBinding;
using DevExpress.XtraSpreadsheet.Services;
            if (barCheckCustomValidationService.Checked) {
                spreadsheetControl1.ReplaceService<IObjectDataSourceValidationService>(new MyObjectDataSourceValidationService());
            }
            else {
                spreadsheetControl1.ReplaceService<IObjectDataSourceValidationService>(new ObjectDataSourceValidationService(spreadsheetControl1));
            }
    public class MyObjectDataSourceValidationService : IObjectDataSourceValidationService {
        public void Validate(IEnumerable<ObjectDataSource> dataSources) {
            // Do nothing to allow loading.
            // Clear the DataSource and DataMember properties to prohibit loading.
            foreach (ObjectDataSource ds in dataSources) {
                ds.DataSource = null;
                ds.DataMember = null;
            };
        }
    }
See Also