Skip to main content
All docs
V24.1

GanttColumnHeaderFilterBuilder.DataSource(Func<DataSourceFactory, OptionsOwnerBuilder>) Method

Specifies the header filter's data source. Mirrors the client-side dataSource option.

Namespace: DevExtreme.AspNet.Mvc.Builders

Assembly: DevExtreme.AspNet.Core.dll

Declaration

public GanttColumnHeaderFilterBuilder DataSource(
    Func<DataSourceFactory, OptionsOwnerBuilder> configurator
)

Parameters

Name Type Description
configurator Func<DataSourceFactory, OptionsOwnerBuilder>

A function that allows you to configure access to data.

Returns

Type Description
GanttColumnHeaderFilterBuilder

A reference to this instance after the method is called.

Remarks

To specify a data source, use a lambda expression. The lambda parameter is a DataSourceFactory class instance that provides methods to configure data access from different sources.

The following example demonstrates how to bind a header filter to an API controller:

@(Html.DevExtreme().Gantt()
    .Columns(columns => {
        columns.Add().HeaderFilter(filter => filter
            .DataSource(ds => ds.Mvc()
                .Controller("MyDataController")
                .LoadAction("Get")
                .Key("ID")
            )
        );
    })
)
See Also