Skip to main content
All docs
V25.1
  • DxSankey.Exported Event

    Fires after the Sankey is exported.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    [Parameter]
    public EventCallback Exported { get; set; }

    Remarks

    The Exported event fires after the Sankey component exports its data:

    Example

    The following code snippet handles the Exported event to display information about the exported file:

    @inject IJSRuntime JSRuntime
    
    <DxSankey Data="@Data"
              @ref=@Sankey
              Exported="@OnExported"
              Width="100%"
              Height="440px"
              SourceFieldName="Source"
              TargetFieldName="Target"
              WeightFieldName="Weight">
        <DxSankeyNodeSettings Width="8" Spacing="30" />
        <DxTitleSettings Text="Commodity Turnover" />
    </DxSankey>
    
    <DxButton Text="Export to PDF" Click="@ExportToPdf" />
    
    @code {
        DxSankey Sankey;
        string fileName = "Custom PDF";
    
        IEnumerable<SankeyDataPoint> Data = Enumerable.Empty<SankeyDataPoint>();
        protected override void OnInitialized() {
            Data = GenerateData();
        }
    
        async Task ExportToPdf() {
            await Sankey.ExportToAsync(fileName, DataExportFormat.Pdf);
        }
        async Task OnExported() {
            await JSRuntime.InvokeVoidAsync("alert", $"The Sankey is exported to the {fileName} file.");
        }
    }
    
    See Also