DataGridColumnLookupBuilder.DataSource(JS) Method
Specifies the data source for the lookup column. Mirrors the client-side dataSource option.
Namespace: DevExtreme.AspNet.Mvc.Builders
Assembly: DevExtreme.AspNet.Core.dll
Declaration
public DataGridColumnLookupBuilder DataSource(
JS js
)
Parameters
Name | Type | Description |
---|---|---|
js | JS | A JavaScript expression that represents a DevExtreme data source. |
Returns
Type | Description |
---|---|
DataGridColumnLookupBuilder | A reference to this instance after the method is called. |
Remarks
This method allows you to bind a lookup column to a DevExtreme data source initialized in JavaScript code.
Use the new JS() expression to specify the data source:
<script>
var myDataSource = new DevExpress.data.ArrayStore(...);
</script>
@(Html.DevExtreme().DataGrid()
.Columns(columns => {
columns.Add().Lookup(lookup => lookup
.DataSource(new JS("myDataSource"))
);
})
)
Note
This is low-level API. Use it only if other method overloads do not suit your requirements.
See Also