Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

IReportDesignerModelBuilder.DataSourceSettings(Action<DataSourceSettings>) Method

Allows you to hide data source actions in the Web Report Designer UI.

Namespace: DevExpress.XtraReports.Web.ReportDesigner.Services

Assembly: DevExpress.XtraReports.v24.2.Web.dll

NuGet Package: DevExpress.Web.Reporting.Common

#Declaration

#Parameters

Name Type Description
configure Action<DataSourceSettings>

A Action that modifies the DataSourceSettings object.

#Returns

Type Description
IReportDesignerModelBuilder

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

#Remarks

The following code hides the Add Data Source button and UI elements that allow the user to change and delete the data source and queries in the Field List panel:

public IActionResult ReportDesigner(
    [FromServices] IReportDesignerModelBuilder reportDesignerModelBuilder, 
    [FromQuery] string reportName) {
    var designerModel = reportDesignerModelBuilder
        .Report(reportName)
        .DataSourceSettings(configure =>
        {
            configure.AllowAddDataSource = false;
            configure.AllowEditDataSource = false;
            configure.AllowRemoveDataSource = false;
        })
        .BuildModel();
    return View(designerModel);
}

The following image shows the Field List panel with highlighted actions that are hidden when the data source settings are applied using the code from the example above:

web-designer-field-list-data-source-settings-highlighted-disabled

See Also