ClientControlContentBuilderBase<TSettings, TImpl>.AutoBind(Boolean) Method
Namespace: DevExpress.AspNetCore.Reporting
Assembly: DevExpress.AspNetCore.Reporting.v24.1.dll
NuGet Package: DevExpress.AspNetCore.Reporting
Declaration
Parameters
Name | Type | Description |
---|---|---|
autoBind | Boolean | True to bind a reporting component to an autogenerated View Model automatically; otherwise, |
Returns
Type | Description |
---|---|
TImpl | A builder instance that can be used to further configure the reporting component. |
Remarks
The default setting for AutoBind
is true
. In this mode, the View Model is created based on the values you specify in a View for the reporting component. This View Model is then used when Knockout library enables component binding.
If AutoBind
is set to false
, an element with a reporting component binding is not inserted automatically. You can create a custom view model for such an element and enable Knockout binding as needed. To create an element with a reporting component binding, call the Build
method of the component builder.
The following code manually activates the Knockout binding of the Report Designer, but the binding is set to the autogenerated View Model.
@{
var viewerRender = Html.DevExpress().ReportDesigner("ReportDesigner1").Height("1000px").AutoBind(false);
}
@viewerRender.Build("reportDesignerOptions")
<script type="text/javascript">
ko.applyBindings({ reportDesignerOptions: @viewerRender });
</script>