ReportDesignerBuilder.AutoBind(Boolean) Method

Specifies whether to bind the Web Report Designer to an autogenerated View Model automatically.

Namespace: DevExpress.AspNetCore.Reporting.ReportDesigner

Assembly: DevExpress.AspNetCore.Reporting.v18.1.dll

Declaration

public ReportDesignerBuilder AutoBind(
    bool autoBind
)
Public Function AutoBind(
    autoBind As Boolean
) As ReportDesignerBuilder

Parameters

Type Name Description
Boolean autoBind

Indicates whether to bind the Report Designer to an autogenerated View Model automatically.

Returns

Type Description
ReportDesignerBuilder

A ReportDesignerBuilder that can be used to further configure the Report Designer.

By default, AutoBind is set to true. In this mode, the Report Designer's View Model is generated based on the values you specified for the Report Designer Builder. Then, this View Model is used when Knockout activates the Report Designer's binding.

Setting AutoBind to false prevents an automatic insert of an element with the Report Designer's binding. This allows you to generate this element specifying a custom View Model for it and to activate Knockout when required, manually. To generate an element with the Report Designer's binding, call the Report Designer Builder's Build method. This method appends a div element containing the dxReportDesigner binding that is set to the View Model's property that you pass as the method's parameter.

In the following code, the Report Designer's Knockout binding is activated manually, but this binding is set to an 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>