FieldListDockPanel.UpdateDataSource(IDesignerHost) Method

Forcibly updates the structure of data sources currently displayed within this FieldListDockPanel object.

Namespace: DevExpress.XtraReports.UserDesigner

Assembly: DevExpress.XtraReports.v18.1.Extensions.dll

Syntax

public void UpdateDataSource(
    IDesignerHost designerHost
)

Parameters

Type Name Description
IDesignerHost designerHost

An object implementing the IDesignerHost interface that is used to manage designer transactions and components.

Use this method when a report's data source is changed, but this change isn't reflected in the Field List, and it is necessary to update the Field List,

Examples

The following code demonstrates how to update the Field List in the End-User Report Designer by calling the FieldListDockPanel.UpdateDataSource method after assigning a data source to a report.

This may be required after a report has been assigned a new data source at runtime without adding this data source to the End-User Report Designer host. For example, this situation occurs when binding to a list data source (e.g., ArrayList), as demonstrated in the following sample.

private void BindReportToData() {
    if (xrDesignPanel1.Report == null)
        return;
     // Create a data source and bind it to a report.
    xrDesignPanel1.Report.DataSource = CreateDataSource();

    // Update the Field List.
    FieldListDockPanel fieldList =
        (FieldListDockPanel)xrDesignDockManager1[DesignDockPanelType.FieldList];
    IDesignerHost host = 
        (IDesignerHost)xrDesignPanel1.GetService(typeof(IDesignerHost));
    fieldList.UpdateDataSource(host);
}