alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class PivotViewEvents<TValue>

    Configures pivot view events.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    PivotViewEvents<TValue>
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.PivotView
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class PivotViewEvents<TValue> : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Type Parameters
    Name Description
    TValue

    A type which provides schema for the pivot component.

    Constructors

    PivotViewEvents()

    Declaration
    public PivotViewEvents()

    Properties

    AggregateCellInfo

    It allows to change the each cell value during engine populating.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<AggregateEventArgs> AggregateCellInfo { get; set; }
    Property Value
    Type Description
    EventCallback<AggregateEventArgs>

    An event callback function.

    AggregateMenuOpen

    Occurs before the aggregate-type context menu is displayed for a field. This event fires when the menu that allows changing aggregation (for example, Sum, Average, Count) is requested but prior to rendering. The event provides access to the target field and menu entries; menu display can be canceled by setting Cancel to true.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<AggregateMenuOpenEventArgs> AggregateMenuOpen { get; set; }
    Property Value
    Type Description
    EventCallback<AggregateMenuOpenEventArgs>

    An event callback function.

    Examples

    The following example demonstrates how to handle the AggregateMenuOpen event to customize or cancel the aggregate context menu:

    <SfPivotView TValue="ExpandoObject">
        <PivotViewEvents TValue="ExpandoObject" AggregateMenuOpen="OnAggregateMenuOpen" />
    </SfPivotView>
    
    @code {
        public void OnAggregateMenuOpen(AggregateMenuOpenEventArgs args)
        {
            // Example: cancel opening the aggregate menu in specific conditions
            // args.Cancel = true;
        }
    }

    BeforeColumnsRender

    Occurs before each column is rendered in the pivot table. This event allows modification of column properties such as width, alignment, autofit, reordering, or visibility before they are displayed.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<ColumnRenderEventArgs> BeforeColumnsRender { get; set; }
    Property Value
    Type
    Action<ColumnRenderEventArgs>
    Remarks

    Use this event to dynamically modify column properties like width, alignment, autofit, reordering, or visibility before rendering.

    Examples

    The following example demonstrates how to use the BeforeColumnsRender event to dynamically modify column properties:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ExpandoObject">
        <PivotViewEvents TValue="ExpandoObject" BeforeColumnsRender="OnBeforeColumnsRender" />
    </SfPivotView>
    @code {
        public void OnBeforeColumnsRender(ColumnRenderEventArgs args)
        {
            args.Width = 150; // Set column width
            args.AutoFit = true; // Enable autofit
        }
    }

    BeforeExport

    Occurs before the pivot table is exported to PDF, Excel, or CSV formats. This event fires when an export operation is initiated through toolbar options or programmatically, providing an opportunity to customize export settings before the export process begins. The event provides access to export configuration properties, enabling customization such as adding headers and footers to PDF documents through PdfExportProperties, or defining themes and styles for Excel exports through ExcelExportProperties.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<BeforeExportEventArgs> BeforeExport { get; set; }
    Property Value
    Type Description
    EventCallback<BeforeExportEventArgs>

    An event callback function.

    Examples

    The following example demonstrates how to handle the BeforeExport event to customize PDF and Excel export properties:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView @ref="pivot" TValue="ProductDetails" AllowPdfExport="true" AllowExcelExport="true" ShowToolbar="true" 
                 Toolbar="@toolbar">
        <PivotViewDataSourceSettings DataSource="@data">
          .....
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" BeforeExport="OnBeforeExport" />
    </SfPivotView>
    
    @code {
    public List<ToolbarItems> toolbar = new List<ToolbarItems> {
        ToolbarItems.Export
    };
        private void OnBeforeExport(BeforeExportEventArgs args)
        {
            // Customize PDF export properties
            PdfExportProperties pdfProperties = new PdfExportProperties();
            PdfHeader header = new PdfHeader()
            {
                FromTop = 0,
                Height = 130,
                Contents = new List<PdfHeaderFooterContent>()
            };
            pdfProperties.Header = header;
            args.PdfExportProperties = pdfProperties;
    
            // Customize Excel export properties
            ExcelExportProperties excelProperties = new ExcelExportProperties();
            ExcelTheme theme = new ExcelTheme();
            ExcelStyle themeStyle = new ExcelStyle()
            {
                FontName = "Segoe UI",
                FontColor = "#666666",
                FontSize = 20
            };
            theme.Header = themeStyle;
            theme.Record = themeStyle;
            theme.Caption = themeStyle;
            excelProperties.Theme = theme;
            args.ExcelExportProperties = excelProperties;
        }
    }

    BeginDrillThrough

    Occurs when a value cell is clicked in the pivot table to initiate drill-through or editing process. This event fires when a value cell receives a click action intended to begin the drill-through or editing process. Editing must be enabled through the PivotViewCellEditSettings configuration for this event to fire. The event provides access to cell information including ColumnHeaders, CurrentCell, CurrentTarget, RawData, RowHeaders, and Value properties; editing initiation can be canceled by setting Cancel to true.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<BeginDrillThroughEventArgs> BeginDrillThrough { get; set; }
    Property Value
    Type Description
    EventCallback<BeginDrillThroughEventArgs>

    An event callback function.

    Examples

    The following example demonstrates how to handle the BeginDrillThrough event to access cell information when drill-through or editing begins:

    <SfPivotView TValue="ProductDetails">
        <PivotViewDataSourceSettings DataSource="@data">
        ....
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" BeginDrillThrough="OnBeginDrillThrough" />
        <PivotViewCellEditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true" Mode="EditMode.Normal" />
    </SfPivotView>
    
    @code {
        private void OnBeginDrillThrough(BeginDrillThroughEventArgs args)
        {
            // Access cell information for drill-through
            // args.CellInfo contains ColumnHeaders, CurrentCell, CurrentTarget, RawData, RowHeaders, and Value
            // Example: cancel drill-through or editing for specific conditions
            // args.Cancel = true;
        }
    }

    CalculatedFieldCreate

    Occurs before a calculated field is created or edited during runtime. This event fires when the OK button is clicked to close the calculated field dialog, providing an opportunity to validate and manage calculated field details before they are applied to the pivot table. The event provides access to calculated field information, settings, and data source configuration, enabling validation to ensure data accuracy and prevent invalid configurations. Application of calculated field changes can be canceled by setting Cancel to true.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<CalculatedFieldCreateEventArgs> CalculatedFieldCreate { get; set; }
    Property Value
    Type Description
    EventCallback<CalculatedFieldCreateEventArgs>

    An event callback function.

    Remarks

    The event provides the following information through CalculatedFieldCreateEventArgs:

    • CalculatedField - Contains the calculated field information (new or existing) entered in the dialog.
    • CalculatedFieldSettings - Provides access to the current calculated field settings of the pivot table.
    • Cancel - Boolean property that prevents dialog changes from being applied when set to true.
    • DataSourceSettings - Contains the current data source configuration including input data, rows, columns, values, filters, and format settings.
    • FieldName - Specifies the name of the field being created or updated.
    Examples

    The following example demonstrates how to handle the CalculatedFieldCreate event to validate calculated field details before saving:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ProductDetails" ShowFieldList="true" AllowCalculatedField="true">
        <PivotViewDataSourceSettings DataSource="@data">
             ....
            <PivotViewCalculatedFieldSettings>
                <PivotViewCalculatedFieldSetting Name="Total" Formula="@totalPrice"></PivotViewCalculatedFieldSetting>
            </PivotViewCalculatedFieldSettings>
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" CalculatedFieldCreate="OnCalculatedFieldCreate" />
    </SfPivotView>
    @code {
        private void OnCalculatedFieldCreate(CalculatedFieldCreateEventArgs args)
        {    
            if (string.IsNullOrEmpty(args.CalculatedField.FormatString))// Example: Cancel if format string is empty
            {
                args.Cancel = true;
            }
        }
    }

    CellClick

    Occurs when a cell is clicked in the pivot table. This event fires whenever any cell in the pivot table receives a click action, providing an opportunity to access and customize cell information based on the clicked cell's properties. The event provides access to comprehensive cell data including row headers, column headers, formatted text, and the underlying raw data through the Data property. Cell appearance and styling can be customized by modifying properties such as CssClass within the event callback.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<CellClickEventArgs> CellClick { get; set; }
    Property Value
    Type Description
    EventCallback<CellClickEventArgs>

    An event callback function.

    Remarks

    The event provides the following information through CellClickEventArgs:

    • Data - Contains comprehensive cell information including RowHeaders, ColumnHeaders, FormattedText, Value, and CssClass properties that can be modified for custom styling.
    • CurrentCell - Provides reference to the clicked cell element in the DOM.
    Examples

    The following example demonstrates how to handle the CellClick event to apply custom styling to specific cells based on their row, column, and value:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ProductDetails">
        <PivotViewDataSourceSettings DataSource="@data">
              ....
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" CellClick="OnCellClick"></PivotViewEvents>
    </SfPivotView>
    
    @code {
        private void OnCellClick(CellClickEventArgs args)
        {   
            if (args.Data.RowHeaders == "France" && args.Data.ColumnHeaders == "FY 2015" && args.Data.FormattedText == "450")  // Apply custom styling when the clicked cell matches specific criteria
            {
                args.Data.CssClass = "e-custom";
            }
        }
    }

    CellDeselected

    It triggers when a cell got deselected in the pivot table.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<CellDeselectEventArgs<TValue>> CellDeselected { get; set; }
    Property Value
    Type Description
    EventCallback<CellDeselectEventArgs<TValue>>

    An event callback function.

    CellDeselecting

    Triggers before any cell deselection occurs.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<CellDeselectEventArgs<TValue>> CellDeselecting { get; set; }
    Property Value
    Type Description
    EventCallback<CellDeselectEventArgs<TValue>>

    An event callback function.

    CellSelected

    Occurs when cell selection is completed in the pivot table. This event fires after one or more cells have been selected, providing comprehensive details about the selected cells including their row headers, column headers, values, and measures. The event provides access to selected cell information through the SelectedCellsInfo property, enabling data retrieval for subsequent operations such as data binding, processing, or integration with other application components. Cell selection must be enabled through the PivotViewSelectionSettings configuration for this event to fire.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<PivotCellSelectedEventArgs> CellSelected { get; set; }
    Property Value
    Type Description
    EventCallback<PivotCellSelectedEventArgs>

    An event callback function.

    Remarks

    The event provides the following information through PivotCellSelectedEventArgs:

    • SelectedCellsInfo - Collection of selected cell information, with each entry containing ColumnHeaders, RowHeaders, Value, Measure, and other cell properties.
    • CurrentCell - Reference to the most recently selected cell element in the DOM.
    • Data - Cell data object containing comprehensive information about the selected cell.
    Examples

    The following example demonstrates how to handle the CellSelected event to display selected cell information in a separate panel:

    @using Syncfusion.Blazor.PivotView
    
    <div>
        <div class="column-8">
            <SfPivotView TValue="ProductDetails" Width="800" Height="340">
                <PivotViewDataSourceSettings TValue="ProductDetails" DataSource="@data">
                  ....
                </PivotViewDataSourceSettings>
                <PivotViewEvents TValue="ProductDetails" CellSelected="OnCellSelected"></PivotViewEvents>
                <PivotViewGridSettings AllowSelection="true">
                    <PivotViewSelectionSettings Mode="SelectionMode.Cell" Type="PivotTableSelectionType.Multiple" CellSelectionMode="PivotCellSelectionMode.Box"></PivotViewSelectionSettings>
                </PivotViewGridSettings>
            </SfPivotView>
        </div>
        <div class="column-4">
            <h5>Event Trace:</h5> <br>
            <div style="height:300px; overflow:auto;">
                @if (SelectedCells != null)
                {
                    @if (SelectedCells.SelectedCellsInfo != null)
                    {
                        @foreach (var cell in SelectedCells.SelectedCellsInfo)
                        {
                            <p>
                                <b>ColumnHeader:</b> @cell.ColumnHeaders<br>
                                <b>RowHeader:</b> @cell.RowHeaders<br>
                                <b>Value:</b> @cell.Value<br>
                                <b>Measure:</b> @cell.Measure
                            </p>
                            <br>
                        }
                    }
                }
            </div>
        </div>
    </div>
    
    @code {
        private void OnCellSelected(PivotCellSelectedEventArgs args)
        {
            SelectedCells = args; // Access selected cells information through args.SelectedCellsInfo
        }
    }

    CellSelecting

    Occurs before cell selection is initiated in the pivot table. This event fires when cell selection is about to begin, providing an opportunity to access cell information and control the selection process before it completes. The event provides access to cell data including the target cell element, click event details, and cell information through properties such as Cancel, CurrentCell, IsCellClick, and Data. Cell selection must be enabled through the PivotViewSelectionSettings configuration by setting AllowSelection to true for this event to fire. The selection process can be canceled by setting Cancel to true, enabling validation or conditional selection logic.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<PivotCellSelectedEventArgs> CellSelecting { get; set; }
    Property Value
    Type Description
    EventCallback<PivotCellSelectedEventArgs>

    An event callback function.

    Remarks

    The event provides the following information through PivotCellSelectedEventArgs:

    • Cancel - Boolean property that prevents cell selection from proceeding when set to true.
    • CurrentCell - Reference to the cell element being selected in the DOM.
    • IsCellClick - Boolean indicator specifying whether the selection was triggered by a cell click action.
    • Data - Cell data object containing comprehensive information about the cell being selected, enabling data transfer to external components for processing or integration.
    Examples

    The following example demonstrates how to handle the CellSelecting event to access cell information before selection is completed:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ProductDetails">
        <PivotViewDataSourceSettings DataSource="@data">
         ....
        </PivotViewDataSourceSettings>
        <PivotViewGridSettings AllowSelection="true">
            <PivotViewSelectionSettings CellSelectionMode="PivotCellSelectionMode.Box" Type="PivotTableSelectionType.Multiple" Mode="SelectionMode.Cell"></PivotViewSelectionSettings>
        </PivotViewGridSettings>
        <PivotViewEvents TValue="ProductDetails" CellSelecting="OnCellSelecting"></PivotViewEvents>
    </SfPivotView>
    
    @code {
        private void OnCellSelecting(PivotCellSelectedEventArgs args)
        {
             args.Cancel = true; // Example: Cancel cell selection
        }
    }
    See Also
    Cell selecting

    ChartPointClick

    Triggers on chart series is point click.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<PointEventArgs> ChartPointClick { get; set; }
    Property Value
    Type Description
    EventCallback<PointEventArgs>

    An event callback function.

    ChartSeriesCreated

    Occurs after pivot chart series are completely rendered. This event fires when chart series rendering is completed, providing an opportunity to access series information and control whether the rendered series should be displayed or revoked. The event is triggered only when the View property is set to Chart, indicating that the pivot data is displayed in chart format rather than grid format. The event provides access to series data and rendering control through properties such as Cancel and Series. Chart series rendering can be canceled by setting Cancel to true, which revokes the rendered series and prevents them from being displayed.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ChartSeriesCreatedEventArgs> ChartSeriesCreated { get; set; }
    Property Value
    Type Description
    EventCallback<ChartSeriesCreatedEventArgs>

    An event callback function.

    Remarks

    The event provides the following information through ChartSeriesCreatedEventArgs:

    • Cancel - Boolean property that revokes the rendered chart series when set to true, preventing them from being displayed.
    • Series - Collection of chart series objects that have been rendered, providing access to series properties for inspection or modification.
    Examples

    The following example demonstrates how to handle the ChartSeriesCreated event to control chart series rendering:

    <SfPivotView TValue="ProductDetails">
        <PivotViewDataSourceSettings DataSource="@data">
         ....
        </PivotViewDataSourceSettings>
        <PivotViewDisplayOption View="View.Chart"></PivotViewDisplayOption>
        <PivotViewEvents TValue="ProductDetails" ChartSeriesCreated="OnChartSeriesCreated"></PivotViewEvents>
    </SfPivotView>
    @code {
        private void OnChartSeriesCreated(ChartSeriesCreatedEventArgs args)
        {     
            args.Cancel = true;// Cancel rendering to revoke chart series display
        }
    }
    See Also
    ChartSeriesCreated

    ChartTooltipRender

    Triggers before chart series is begging rendered.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<TooltipRenderEventArgs> ChartTooltipRender { get; set; }
    Property Value
    Type
    EventCallback<TooltipRenderEventArgs>

    ConditionalFormatting

    Occurs when conditional formatting is applied in the pivot table. This event allows modification of default format settings such as colors, styles, and conditions before they are applied.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<ConditionalFormatSettings> ConditionalFormatting { get; set; }
    Property Value
    Type
    Action<ConditionalFormatSettings>
    Remarks

    Use this event to dynamically modify default format properties like colors, styles, and conditions before applying them in the pivot table.

    Examples

    The following example demonstrates how to use the ConditionalFormatting event to dynamically modify the default format settings:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ProductDetails" AllowConditionalFormatting="true">
        <PivotViewEvents TValue="ProductDetails" ConditionalFormatting="conditionalFormat" />
    </SfPivotView>
    
    @code {
        private void conditionalFormat(ConditionalFormatSettings args)
        {       
            args.Style.BackgroundColor = "Blue";// To change the conditional formatting settings in the conditional format dialog
            args.Value1 = 23459;
        }
    }

    Created

    Occurs when the pivot table component has been created and is fully initialized. This event fires once during the component lifecycle, immediately after the component has been rendered for the first time and all initial settings have been applied. The event provides an opportunity to perform post-initialization operations such as accessing component properties, applying custom configurations, or executing additional setup logic. This event does not provide any specific event arguments and uses a generic object parameter.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<object> Created { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An event callback function.

    Examples

    The following example demonstrates how to handle the Created event to perform operations after the pivot table is initialized:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ProductDetails" @ref="pivot">
        <PivotViewDataSourceSettings DataSource="@data">
         ....
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" Created="OnCreated"></PivotViewEvents>
    </SfPivotView>
    
    @code {
        private SfPivotView<ProductDetails> pivot;
    
        private void OnCreated()
        {
            // Perform post-initialization operations
            // Component is fully initialized and ready for interaction
        }
    }

    DataBound

    Occurs after the pivot table has been rendered and the data source has been populated. This event fires when the data binding process is completed and the pivot table has been fully rendered with the bound data. The event provides an opportunity to perform post-rendering operations such as accessing rendered data, applying custom visual modifications, or executing additional logic after data population. This event does not provide any specific event arguments and uses a generic object parameter.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<object> DataBound { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An event callback function.

    Examples

    The following example demonstrates how to handle the DataBound event to perform operations after the pivot table is rendered with data:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ProductDetails" @ref="pivot">
        <PivotViewDataSourceSettings DataSource="@data">
         ....
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" DataBound="OnDataBound"></PivotViewEvents>
    </SfPivotView>
    
    @code {
        private SfPivotView<ProductDetails> pivot;
    
        private void OnDataBound()
        {
            // Perform post-rendering operations
            // Data binding is complete and pivot table is fully rendered
        }
    }
    See Also
    Data Bound

    Destroyed

    Occurs when the pivot table component is being destroyed and disposed. This event fires during the component disposal process, immediately before the component is removed from the DOM and all resources are released. The event provides an opportunity to perform cleanup operations such as releasing references, canceling subscriptions, or executing final operations before component destruction. This event does not provide any specific event arguments and uses a generic object parameter.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<object> Destroyed { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An event callback function.

    Examples

    The following example demonstrates how to handle the Destroyed event to perform cleanup operations before the pivot table is disposed:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ProductDetails" @ref="pivot">
        <PivotViewDataSourceSettings DataSource="@data">
         ....
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" Destroyed="OnDestroyed"></PivotViewEvents>
    </SfPivotView>
    
    @code {
        private SfPivotView<ProductDetails> pivot;
    
        private void OnDestroyed()
        {
            // Perform cleanup operations before component destruction
            // Release resources, cancel subscriptions, or execute final operations
        }
    }

    Drill

    Occurs when a row or column header is expanded or collapsed in the pivot table. This event fires when a member in the pivot table hierarchy is expanded to reveal child members or collapsed to hide them, providing an opportunity to access drill information and customize the drill operation. The event provides access to drill details through the DrillInfo property, enabling modifications such as changing the delimiter or altering the drill action for the respective item. The event provides information about the drilled cell, current data state, and the component instance through Pivotview.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<DrillArgs<TValue>> Drill { get; set; }
    Property Value
    Type Description
    EventCallback<DrillArgs<TValue>>

    An event callback function.

    Remarks

    The event provides the following information through DrillArgs<T>:

    • DrillInfo - Contains information about the drilled cell including field name, member name, drill action (expand/collapse), and cell position.
    • Pivotview - Reference to the pivot table component instance, enabling access to component properties and methods.
    Examples

    The following example demonstrates how to handle the Drill event to access drill information when a header is expanded or collapsed:

    <SfPivotView TValue="ProductDetails">
        <PivotViewDataSourceSettings DataSource="@data">
         ....
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" Drill="OnDrill"></PivotViewEvents>
    </SfPivotView>
    @code {
        private void OnDrill(DrillArgs<ProductDetails> args)
        {
            args.Cancel = true; //args.DrillInfo --> Here you can get drilled cell information.
        }
    }
    See Also
    Drill

    DrillThrough

    Occurs when a value cell is clicked in the pivot table during a drill-through operation. This event fires when a value cell receives a click action to access the underlying raw data behind an aggregated value, providing an opportunity to view and process detailed information. The drill-through feature must be enabled by setting AllowDrillThrough to true for this event to fire. The event provides access to comprehensive cell information including column headers, row headers, raw data, and the aggregated value through the DrillThroughEventArgs object. This event enables viewing and processing of the raw data records that contribute to a specific aggregated value in the pivot table.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<DrillThroughEventArgs> DrillThrough { get; set; }
    Property Value
    Type Description
    EventCallback<DrillThroughEventArgs>

    An event callback function.

    Remarks

    The event provides the following information through DrillThroughEventArgs:

    • ColumnHeaders - Contains the column header text of the clicked value cell.
    • CurrentCell - Reference to the clicked cell element in the DOM.
    • CurrentTarget - Provides the current target element information.
    • RawData - Collection of raw data records that contribute to the aggregated value in the clicked cell.
    • RowHeaders - Contains the row header text of the clicked value cell.
    • Value - Contains the aggregated value of the clicked cell.
    Examples

    The following example demonstrates how to handle the DrillThrough event to access raw data information when a value cell is clicked:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ProductDetails" AllowDrillThrough="true">
        <PivotViewDataSourceSettings DataSource="@data">
            ....
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" DrillThrough="OnDrillThrough"></PivotViewEvents>
    </SfPivotView>
    
    @code {
        private void OnDrillThrough(DrillThroughEventArgs args)
        {
            args.Cancel = true; //args --> Here you can get the information of the clicked cell.
        }
    }
    See Also
    Drill Through

    EditCompleted

    It triggers when editing is made in the raw data of pivot table.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<EditCompletedEventArgs<TValue>> EditCompleted { get; set; }
    Property Value
    Type Description
    EventCallback<EditCompletedEventArgs<TValue>>

    An event callback function.

    EnginePopulated

    Occurs after the pivot engine is populated with updated report settings. This event fires when the data engine completes populating with the current report configuration, providing an opportunity to customize data source settings and synchronize components such as the pivot table and field list. The event is available in both the pivot table and field list components, enabling bidirectional synchronization when report modifications occur through either component. In the field list, this event triggers when fields are added, removed, or rearranged, allowing the updated report to be sent to the pivot table via UpdateViewAsync to refresh the display. In the pivot table, this event triggers when the report is updated, allowing the modified report to be passed to the field list via UpdateAsync to maintain synchronization.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<EnginePopulatedEventArgs> EnginePopulated { get; set; }
    Property Value
    Type Description
    EventCallback<EnginePopulatedEventArgs>

    An event callback function.

    Remarks

    The event provides the following information through EnginePopulatedEventArgs:

    • DataSourceSettings - Contains the current data source configuration including rows, columns, values, filters, and format settings after engine population.
    • PivotFieldList - Reference to the field list component instance when the event is triggered from the field list.
    • PivotValues - Collection of pivot values representing the processed data after engine population.
    Examples

    The following example demonstrates how to handle the EnginePopulated event to synchronize the pivot table and field list:

    <SfPivotView TValue="ProductDetails" ID="pivotview" @ref="pivotView" Height="530">
        <PivotViewEvents TValue="ProductDetails" EnginePopulated="OnPivotEnginePopulated"></PivotViewEvents>
    </SfPivotView>
    
    <SfPivotFieldList TValue="ProductDetails" ID="fieldlist" @ref="fieldList" RenderMode="Mode.Fixed">
        <PivotFieldListDataSourceSettings DataSource="@data" EnableSorting="true">
           ....
        </PivotFieldListDataSourceSettings>
        <PivotFieldListEvents TValue="ProductDetails" EnginePopulated="OnFieldListEnginePopulated"></PivotFieldListEvents>
    </SfPivotFieldList>
    @code {
        private SfPivotFieldList<ProductDetails> fieldList;
        private SfPivotView<ProductDetails> pivotView;
    
        private void OnPivotEnginePopulated(EnginePopulatedEventArgs args)
        {
            // Synchronize field list with pivot table changes
            this.fieldList.UpdateAsync(this.pivotView);
        }
    
        private void OnFieldListEnginePopulated(EnginePopulatedEventArgs args)
        {
            // Synchronize pivot table with field list changes
            this.fieldList.UpdateViewAsync(this.pivotView);
        }
    }

    EnginePopulating

    Occurs before the pivot engine begins populating data with report settings. This event fires when the data engine is about to start processing the report configuration, providing an opportunity to customize data source settings before engine population begins. The event is available in both the Pivot Table and Field List components, triggering whenever report modifications occur through their respective interfaces. In the field list, this event triggers when the report is modified through field list UI operations such as adding, removing, or rearranging fields. In the pivot table, this event triggers when the report is modified via grouping bar, toolbar, or other pivot table UI interactions. Data source settings can be modified before engine processing begins, enabling customization of the report configuration prior to data population.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<EnginePopulatingEventArgs> EnginePopulating { get; set; }
    Property Value
    Type Description
    EventCallback<EnginePopulatingEventArgs>

    An event callback function.

    Remarks

    The event provides the following information through EnginePopulatingEventArgs:

    • DataSourceSettings - Contains the current data source configuration that can be modified before engine population, including rows, columns, values, filters, and format settings.
    Examples

    The following example demonstrates how to handle the EnginePopulating event to modify report settings before the pivot engine populates data:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ProductDetails">
        <PivotViewDataSourceSettings DataSource="@data">
          ....
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" EnginePopulating="OnEnginePopulating"></PivotViewEvents>
    </SfPivotView>
    
    @code {
        private void OnEnginePopulating(EnginePopulatingEventArgs args)
        {
            // Modify report settings before engine populates
            // args.DataSourceSettings provides access to current configuration
            // Customize rows, columns, values, filters, or other settings as needed
        }
    }
    See Also
    EnginePopulating

    ExcelHeaderQueryCellInfo

    Occurs when each column header cell is exported to an Excel document. This event fires for every column header cell during Excel export operations, providing an opportunity to customize the appearance and content of header cells in the exported Excel file. Excel export must be enabled by setting AllowExcelExport to true for this event to fire. The event provides access to cell information, styling properties, and position coordinates, enabling customization of header cell values, colors, fonts, and other visual properties before they are written to the Excel document. When virtualization is disabled, column information is available through the Column property; when enabled, row and column indices are provided for accessing cell data from the pivot values collection.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<ExcelHeaderQueryCellInfoEventArgs> ExcelHeaderQueryCellInfo { get; set; }
    Property Value
    Type Description
    Action<ExcelHeaderQueryCellInfoEventArgs>

    An event callback function.

    Remarks

    The event provides the following information through ExcelHeaderQueryCellInfoEventArgs:

    • Value - Contains the value of the current cell in the exported Excel sheet.
    • Column - Contains information about the column to which the current cell belongs. This property is applicable only when virtualization is disabled.
    • Cell - Contains the current cell information including properties and metadata.
    • Style - Contains style properties that can be applied to the cell, including background color, font styles, and borders.
    • RowIndex - Contains the row index required to access the current cell information from the pivot values collection when virtualization is enabled.
    • ColumnIndex - Contains the column index required to access the current cell information from the pivot values collection when virtualization is enabled.
    Examples

    The following example demonstrates how to handle the ExcelHeaderQueryCellInfo event to apply custom styling to column header cells during Excel export:

    <SfButton OnClick="OnExcelExport" Content="Excel Export"></SfButton>
    <SfPivotView TValue="ProductDetails" @ref="pivot" EnableVirtualization="true" AllowExcelExport="true">
        <PivotViewDataSourceSettings DataSource="@data" ExpandAll="false" EnableSorting="true">
         ....
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" ExcelHeaderQueryCellInfo="OnExcelHeaderQueryCellInfo"></PivotViewEvents>
    </SfPivotView>
    
    @code {
        private void OnExcelHeaderQueryCellInfo(ExcelHeaderQueryCellInfoEventArgs args)
        {    
                args.Style.BackColor = args.Cell.CellStyle.BackColor = "#e3e384"; // Apply custom styling to the header cell
                args.Style.Bold = args.Cell.CellStyle.Bold = true;
        }
    }
    See Also
    ExcelHeaderQueryCellInfo

    ExcelQueryCellInfo

    Gets or sets the event callback that is triggered whenever a pivot table data cell is exported to an Excel document. This event occurs when clicks the Excel export icon in the toolbar or triggers an export through an external button.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<ExcelQueryCellInfoEventArgs<TValue>> ExcelQueryCellInfo { get; set; }
    Property Value
    Type
    Action<ExcelQueryCellInfoEventArgs<TValue>>
    Remarks

    This event handler receives an ExcelQueryCellInfoEventArgs<T> object, which provides details about the corresponding row and cell being exported. You can use this event to customize the appearance and contents of individual data cells in the exported Excel document.

    Examples

    This example demonstrates how to use the ExcelQueryCellInfo event to customize the exported Excel document.

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ExpandoObject" AllowExcelExport="true" ShowToolbar="true" 
                 Toolbar="@(new List<ToolbarItems>() { ToolbarItems.Export })">
        <PivotViewEvents TValue="ExpandoObject" ExcelQueryCellInfo="ExcelQueryEvent">
        </PivotViewEvents>
    </SfPivotView>
    
    @code {
        SfPivotView<ExpandoObject> pivot;
    
        public void ExcelQueryEvent(ExcelQueryCellInfoEventArgs<ExpandoObject> args)
        {
            // Customize the content or style of the exported Excel cells here.
            args.Style.BackColor = "#FFFF00"; // Highlight the cell with yellow color.
        }
    }

    ExportCompleted

    The event triggers when exporting to PDF, Excel, or CSV is complete.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<object> ExportCompleted { get; set; }
    Property Value
    Type
    Action<object>

    FetchReport

    Occurs when the report dropdown list is opened in the toolbar to retrieve saved reports. This event fires when the Load Report dropdown icon is clicked in the toolbar, providing an opportunity to fetch report names from storage and populate the dropdown list with available saved reports. The event provides access to report name management through the ReportName property, enabling retrieval of report names from local storage, databases, or other storage mechanisms for display in the dropdown list. A default report can be specified to load automatically during initial rendering by setting the DefaultReportName property.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FetchReportArgs> FetchReport { get; set; }
    Property Value
    Type Description
    EventCallback<FetchReportArgs>

    An event callback function.

    Remarks

    The event provides the following information through FetchReportArgs:

    • ReportName - Array property that should be populated with the list of available report names retrieved from storage.
    • DefaultReportName - String property that specifies which report should be loaded by default during initial rendering.
    Examples

    The following example demonstrates how to handle the FetchReport event to retrieve saved report names from storage and populate the toolbar dropdown:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView @ref="pivot" TValue="ProductDetails" ShowToolbar="true" Toolbar="@toolbar">
        <PivotViewDataSourceSettings DataSource="@data">
         ....        
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" FetchReport="OnFetchReport">
        </PivotViewEvents>
    </SfPivotView>
    
    @code {
        private List<ToolbarItems> toolbar = new List<ToolbarItems> {
            ToolbarItems.Load,
            ToolbarItems.Save,
            ToolbarItems.SaveAs,
            ToolbarItems.Remove,
            ToolbarItems.Rename
        };
        private void OnFetchReport(FetchReportArgs args)
        {
            args.ReportName = this.reportName.ToArray();
            // Set the default report name for initial rendering
            if (onInit)
            {
                args.DefaultReportName = "Default Report";
                onInit = false;
            }
        }
    }

    FieldDragStart

    Occurs when a field drag operation begins in the pivot table. This event fires when a field starts being dragged from its current axis position in the grouping bar or field list, providing an opportunity to control and customize the drag operation before it proceeds. The grouping bar or field list must be enabled for this event to fire, as field dragging is only possible through these UI components. The event provides access to comprehensive field information including the field name, complete field details, source axis, and data source settings through the FieldDragStartEventArgs object. The drag operation can be canceled by setting Cancel to true, enabling conditional logic to limit or prevent field dragging based on specific requirements.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FieldDragStartEventArgs> FieldDragStart { get; set; }
    Property Value
    Type Description
    EventCallback<FieldDragStartEventArgs>

    An event callback function.

    Remarks

    The event provides the following information through FieldDragStartEventArgs:

    • FieldName - Contains the name of the field being dragged.
    • FieldItem - Contains the complete field details including all properties defined in PivotViewDataSourceSettings<TValue>.
    • Axis - Specifies the axis (columns, rows, values, or filters) from which the field is being dragged.
    • Cancel - Boolean property that prevents the field from being dragged when set to true.
    • DataSourceSettings - Contains the current data source configuration of the pivot table including rows, columns, values, filters, and format settings.
    Examples

    The following example demonstrates how to handle the FieldDragStart event to prevent fields from being dragged out of specific axes:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ProductDetails" ShowGroupingBar="true">
        <PivotViewDataSourceSettings DataSource="@data">
         ....
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" FieldDragStart="OnFieldDragStart"></PivotViewEvents>
    </SfPivotView>
    @code {
        private void OnFieldDragStart(FieldDragStartEventArgs args)
        {
            if (args.Axis == "rows")
            {
                args.Cancel = true;
            }
        }
    }
    See Also
    FieldDragStart

    FieldDrop

    It triggers before a field drops into any axis. The FieldDrop event is triggered whenever a field is dragged and dropped into a different axis in the Pivot Table. This event helps control whether a field should be allowed to move to a new axis by using the event’s parameters. The event provides the following information.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FieldDropEventArgs> FieldDrop { get; set; }
    Property Value
    Type Description
    EventCallback<FieldDropEventArgs>

    An event callback function.

    FieldDropped

    It triggers after a field dropped into the axis.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FieldDroppedEventArgs> FieldDropped { get; set; }
    Property Value
    Type Description
    EventCallback<FieldDroppedEventArgs>

    An event callback function.

    FieldListRefreshed

    It allows to identify whether the field list updated or not.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FieldListRefreshedEventArgs> FieldListRefreshed { get; set; }
    Property Value
    Type Description
    EventCallback<FieldListRefreshedEventArgs>

    An event callback function.

    FieldRemove

    It triggers before removing the field from any axis during runtime.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<FieldRemoveEventArgs> FieldRemove { get; set; }
    Property Value
    Type Description
    EventCallback<FieldRemoveEventArgs>

    An event callback function.

    HyperlinkCellClicked

    It triggers when a hyperlink cell is clicked in the pivot table.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<HyperCellClickEventArgs> HyperlinkCellClicked { get; set; }
    Property Value
    Type Description
    EventCallback<HyperCellClickEventArgs>

    An event callback function.

    LoadReport

    It allows to load the report from specified storage.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<LoadReportArgs> LoadReport { get; set; }
    Property Value
    Type Description
    EventCallback<LoadReportArgs>

    An event callback function.

    MemberEditorOpen

    Occurs before the filter dialog opens when the filter icon is clicked on a specific field in the grouping bar or field list. This event allows modification of the field members displayed in the filter dialog.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<MemberEditorOpenEventArgs> MemberEditorOpen { get; set; }
    Property Value
    Type
    Action<MemberEditorOpenEventArgs>
    Remarks

    Use this event to modify the field members shown in the filter dialog or to cancel the dialog from opening.

    Examples

    The following example demonstrates how to use the MemberEditorOpen event to modify the field members displayed in the filter dialog or cancel its opening:

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ExpandoObject">
        <PivotViewEvents TValue="ExpandoObject" MemberEditorOpen="OnMemberEditorOpen" />
    </SfPivotView>
    
    @code {
        public void OnMemberEditorOpen(MemberEditorOpenEventArgs args)
        {
            // Example: Modify field members or cancel the dialog
            args.Cancel = true; // Cancel opening the dialog
        }
    }

    MemberFiltering

    It triggers before the filtering applied.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<MemberFilteringEventArgs> MemberFiltering { get; set; }
    Property Value
    Type Description
    EventCallback<MemberFilteringEventArgs>

    An event callback function.

    NewReport

    It allows to set the new report.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<NewReportArgs> NewReport { get; set; }
    Property Value
    Type Description
    EventCallback<NewReportArgs>

    An event callback function.

    NumberFormatting

    It triggers before number format is apllied to specific field during runtime.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<NumberFormattingEventArgs> NumberFormatting { get; set; }
    Property Value
    Type Description
    EventCallback<NumberFormattingEventArgs>

    An event callback function.

    OnActionBegin

    It triggers when UI action begins in the pivot table. The UI actions used to trigger this event such as drill down/up, value sorting, built-in toolbar options, grouping bar and field list buttons actions such as sorting, filtering, editing, aggregate type change and so on, CRUD operation in editing.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<PivotActionBeginEventArgs> OnActionBegin { get; set; }
    Property Value
    Type Description
    Action<PivotActionBeginEventArgs>

    An event callback function.

    Remarks

    This event handler receives a PivotActionBeginEventArgs object that provides information about the current UI action of the pivot table.

    Examples
    <SfPivotView>
        <PivotViewEvents TValue="ProductDetails" OnActionBegin="ActionBegin"></PivotViewEvents>
    </SfPivotView>
    
    @code {
        public void ActionBegin (PivotActionBeginEventArgs args)
        {
    
        }
    }

    OnActionComplete

    It triggers when UI action in the pivot table completed. The UI actions used to trigger this event such as drill down/up, value sorting, built-in toolbar options, grouping bar and field list buttons actions such as sorting, filtering, editing, aggregate type change and so on, CRUD operation in editing.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<PivotActionCompleteEventArgs<TValue>> OnActionComplete { get; set; }
    Property Value
    Type Description
    Action<PivotActionCompleteEventArgs<TValue>>

    An event callback function.

    Remarks

    This event handler receives a PivotActionCompleteEventArgs<T> object that provides information about the current UI action of the pivot table.

    Examples
    <SfPivotView>
        <PivotViewEvents TValue="ProductDetails" OnActionComplete="ActionCompleted"></PivotViewEvents>
    </SfPivotView>
    
    @code {
        public void ActionCompleted (PivotActionCompleteEventArgs<ProductDetails> args)
        {
    
        }
    }

    OnActionFailure

    It triggers when UI action failed to achieve the desired results in the pivot table. The UI actions used to trigger this event such as drill down/up, value sorting, built-in toolbar options, grouping bar and field list buttons actions such as sorting, filtering, editing, aggregate type change and so on, CRUD operation in editing.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<PivotActionFailureEventArgs> OnActionFailure { get; set; }
    Property Value
    Type Description
    Action<PivotActionFailureEventArgs>

    An event callback function.

    Remarks

    This event handler receives a PivotActionFailureEventArgs object that provides information about the error in pivot table. Stack trace of exceptions, if any, can also be obtained here.

    Examples
    <SfPivotView>
        <PivotViewEvents TValue="ProductDetails" OnActionFailure="ActionFailed"></PivotViewEvents>
    </SfPivotView>
    
    @code {
        public void ActionFailed (PivotActionFailureEventArgs args)
        {
    
        }
    }

    OnAxisLabelRender

    Triggers before each axis label is rendered.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<AxisLabelRenderEventArgs> OnAxisLabelRender { get; set; }
    Property Value
    Type Description
    Action<AxisLabelRenderEventArgs>

    An event callback function.

    OnLegendClick

    Triggers when the chart legend of a specific series is clicked.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<LegendClickEventArgs> OnLegendClick { get; set; }
    Property Value
    Type Description
    EventCallback<LegendClickEventArgs>

    An event callback function.

    Remarks

    This event handler receives a LegendClickEventArgs object that specifies the event arguments available for the legend item click events in the pivot chart.

    Examples
    <SfPivotView>
        <PivotViewEvents TValue="ProductDetails" OnLegendClick="OnLegendClick"></PivotViewEvents>
    </SfPivotView>
    
    @code {
        public void OnLegendClick(LegendClickEventArgs args)
        {
    
        }
    }

    OnLegendItemRender

    Triggers before chart legend is begging rendered.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<LegendRenderEventArgs> OnLegendItemRender { get; set; }
    Property Value
    Type Description
    Action<LegendRenderEventArgs>

    An event callback function.

    OnLoad

    It allows any customization on the pivot table component properties on initial rendering. Based on the changes, pivot table will be redered.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<LoadEventArgs<TValue>> OnLoad { get; set; }
    Property Value
    Type Description
    EventCallback<LoadEventArgs<TValue>>

    An event callback function.

    OnPointRender

    Triggers before chart point is begging rendered.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<PointRenderEventArgs> OnPointRender { get; set; }
    Property Value
    Type Description
    EventCallback<PointRenderEventArgs>

    An event callback function.

    OnToolbarClick

    It allows to change the toolbar items.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ClickEventArgs> OnToolbarClick { get; set; }
    Property Value
    Type Description
    EventCallback<ClickEventArgs>

    An event callback function.

    Parent

    Pivot component.

    Declaration
    [CascadingParameter]
    protected SfPivotView<TValue>? Parent { get; set; }
    Property Value
    Type
    SfPivotView<TValue>

    PdfCellRender

    It allows any customization of Pivot cell style while PDF exporting.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<PdfCellRenderArgs> PdfCellRender { get; set; }
    Property Value
    Type Description
    EventCallback<PdfCellRenderArgs>

    An event callback function.

    PdfHeaderQueryCellInfo

    Occurs when each column header cell is exported to a PDF document. This event fires for every column header cell during PDF export operations, providing an opportunity to customize the appearance and content of header cells in the exported PDF file. PDF export must be enabled by setting AllowPdfExport to true for this event to fire. The event provides access to cell information, styling properties, and position coordinates, enabling customization of header cell values, colors, fonts, and other visual properties before they are written to the PDF document. When virtualization is disabled, column information is available through the Column property; when enabled, row and column indices are provided for accessing cell data from the pivot values collection.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<PdfHeaderQueryCellInfoEventArgs> PdfHeaderQueryCellInfo { get; set; }
    Property Value
    Type Description
    Action<PdfHeaderQueryCellInfoEventArgs>

    An event callback function.

    Remarks

    The event provides the following information through PdfHeaderQueryCellInfoEventArgs:

    • Column - Contains information about the current header cell being exported. This property is applicable only when virtualization is disabled.
    • Cell - Contains the current cell information including value and metadata.
    • Style - Contains style properties that can be used to format the cell, including background color, text color, font, and borders.
    • RowIndex - Contains the row index required to access the current cell information from the pivot values collection when virtualization is enabled.
    • ColumnIndex - Contains the column index required to access the current cell information from the pivot values collection when virtualization is enabled.
    Examples

    The following example demonstrates how to handle the PdfHeaderQueryCellInfo event to apply custom styling to column header cells during PDF export:

    @using Syncfusion.Blazor.PivotView
    @using Syncfusion.Blazor.Buttons
    @using Syncfusion.Blazor.Grids
    
    <SfButton OnClick="OnPdfExport" Content="Pdf Export"></SfButton>
    <SfPivotView TValue="ProductDetails" @ref="pivot" EnableVirtualization="true" AllowPdfExport="true">
        <PivotViewDataSourceSettings DataSource="@data" EnableSorting="true">
           ....
        </PivotViewDataSourceSettings>
        <PivotViewEvents TValue="ProductDetails" PdfHeaderQueryCellInfo="OnPdfHeaderQueryCellInfo"></PivotViewEvents>
    </SfPivotView>
    @code {
        // Customize column header cell styles during PDF export
        private void OnPdfHeaderQueryCellInfo(PdfHeaderQueryCellInfoEventArgs args)
        {
                // Apply custom styling to the header cell
                args.Style.BackgroundBrush = new Syncfusion.PdfExport.PdfSolidBrush(
                    new Syncfusion.PdfExport.PdfColor(System.Drawing.Color.LightGoldenrodYellow));
                args.Style.TextPen = new Syncfusion.PdfExport.PdfPen(System.Drawing.Color.IndianRed);
            }
        }
    }
    See Also
    PdfHeaderQueryCellInfo

    PdfQueryCellInfo

    Gets or sets the event callback that is triggered whenever a pivot table data cell is exported to a PDF document. This event occurs when click the PDF export icon in the toolbar or triggers an export through an external button.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<PdfQueryCellInfoEventArgs<TValue>> PdfQueryCellInfo { get; set; }
    Property Value
    Type
    Action<PdfQueryCellInfoEventArgs<TValue>>
    Remarks

    This event handler receives a PdfQueryCellInfoEventArgs<T> object, which provides details about the corresponding row and cell being exported. You can use this event to customize the appearance and contents of individual data cells in the exported PDF document.

    Examples

    This example demonstrates how to use the PdfQueryCellInfo event to customize the exported PDF document.

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ExpandoObject" AllowPdfExport="true" ShowToolbar="true" 
                 Toolbar="@(new List<ToolbarItems>() { ToolbarItems.Export })">
        <PivotViewEvents TValue="ExpandoObject" PdfQueryCellInfo="PdfQueryEvent">
        </PivotViewEvents>
    </SfPivotView>
    
    @code {
        SfPivotView<ExpandoObject> pivot;
    
        public void PdfQueryEvent(PdfQueryCellInfoEventArgs<ExpandoObject> args)
        {     
            args.Style.TextBrushColor = "#FF5733"; // Set text color to orange.   // Customize the content or style of the exported PDF cells here.
        }
    }

    QueryCellInfo

    Triggered every time a request is made to access cell information, element, or data. It will get triggered before the cell element is appended to the Grid element.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<QueryCellInfoEventArgs<TValue>> QueryCellInfo { get; set; }
    Property Value
    Type Description
    EventCallback<QueryCellInfoEventArgs<TValue>>

    An event callback function.

    RemoveReport

    It allows you to remove the current report from the specified storage.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<RemoveReportArgs> RemoveReport { get; set; }
    Property Value
    Type Description
    EventCallback<RemoveReportArgs>

    An event callback function.

    RenameReport

    It allows you to rename the current report.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<RenameReportArgs> RenameReport { get; set; }
    Property Value
    Type Description
    EventCallback<RenameReportArgs>

    An event callback function.

    ResizeStart

    It triggers when column resize starts in the pivot table.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ResizeArgs> ResizeStart { get; set; }
    Property Value
    Type Description
    EventCallback<ResizeArgs>

    An event callback function.

    ResizeStop

    It triggers when column resize ends in the pivot table.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ResizeArgs> ResizeStop { get; set; }
    Property Value
    Type Description
    EventCallback<ResizeArgs>

    An event callback function.

    RowDeselected

    Triggers when a selected row is deselected.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<RowDeselectEventArgs<TValue>> RowDeselected { get; set; }
    Property Value
    Type Description
    EventCallback<RowDeselectEventArgs<TValue>>

    An event callback function.

    RowDeselecting

    Triggers before deselecting the selected row.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<RowDeselectEventArgs<TValue>> RowDeselecting { get; set; }
    Property Value
    Type Description
    EventCallback<RowDeselectEventArgs<TValue>>

    An event callback function.

    RowSelected

    Triggers after a row is selected.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<RowSelectEventArgs<TValue>> RowSelected { get; set; }
    Property Value
    Type Description
    EventCallback<RowSelectEventArgs<TValue>>

    An event callback function.

    RowSelecting

    Triggers before row selection occurs.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<RowSelectingEventArgs<TValue>> RowSelecting { get; set; }
    Property Value
    Type Description
    EventCallback<RowSelectingEventArgs<TValue>>

    An event callback function.

    SaveReport

    It allows you to save the report to the specified storage.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<SaveReportArgs> SaveReport { get; set; }
    Property Value
    Type Description
    EventCallback<SaveReportArgs>

    An event callback function.

    ServiceInvoked

    Gets or sets the delegate that is invoked after a service request has been processed by the server engine. This event is triggered when the Pivot Table receives a response from the server, allowing customization of the response or additional UI actions before it is applied to Pivot Table UI.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<ServiceInvokedEventArgs> ServiceInvoked { get; set; }
    Property Value
    Type Description
    Action<ServiceInvokedEventArgs>

    A delegate of type Action<T> that takes an instance of ServiceInvokedEventArgs as its parameter. This can be used to inspect, modify, or cancel the processing of the response data.

    Remarks

    The ServiceInvoked event is useful for handling the server response received by the Pivot Table component. It provides access to the raw response and allows modification or cancellation of the default behavior using the ServiceInvokedEventArgs instance.

    Examples

    The following example demonstrates how to handle the ServiceInvoked event in the PivotViewEvents to conditionally cancel further response processing.

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ExpandoObject" Height="400px">
        <PivotViewEvents TValue="ExpandoObject" ServiceInvoked="OnServiceInvoked" />
    </SfPivotView>
    
    @code {
        public void OnServiceInvoked(ServiceInvokedEventArgs args)
        {
            // Cancel further response processing if a specific condition is met
            if (args?.Data != null && args.Data.ToString().Contains("error"))
            {
                args.Cancel = true;
            }
        }
    }

    ServiceInvoking

    Gets or sets the delegate that is invoked before a service request is sent from the Pivot Table to the server. This event is triggered before initiating a server call, allowing customization of the request parameters.

    Declaration
    [Parameter]
    [JsonIgnore]
    public Action<ServiceInvokeEventArgs> ServiceInvoking { get; set; }
    Property Value
    Type Description
    Action<ServiceInvokeEventArgs>

    A delegate of type Action<T> that takes an instance of ServiceInvokeEventArgs as its parameter. This can be used to modify the request data, set headers, or append custom properties before the request is sent.

    Remarks

    The ServiceInvoking event is useful for customizing the outgoing server request made by the Pivot Table component. You can modify the request using the ServiceInvokeEventArgs object, such as enabling sorting, adding filters, or injecting additional context-specific properties.

    Examples

    The following example demonstrates how to handle the ServiceInvoking event in the PivotViewEvents to add custom properties to the service request.

    @using Syncfusion.Blazor.PivotView
    
    <SfPivotView TValue="ExpandoObject" Height="400px">
        <PivotViewEvents TValue="ExpandoObject" ServiceInvoking="OnServiceInvoking" />
    </SfPivotView>
    
    @code {
        public void OnServiceInvoking(ServiceInvokeEventArgs args)
        {
            // Add custom properties and enable sorting before sending the request
            args.DataSourceSettings.EnableSorting = true;
            args.CustomProperties = new { Department = "Finance", Year = "2025" };
        }
    }

    ToolbarRendered

    It allows to change the toolbar items.

    Declaration
    [Parameter]
    [JsonIgnore]
    public EventCallback<ToolbarArgs> ToolbarRendered { get; set; }
    Property Value
    Type Description
    EventCallback<ToolbarArgs>

    An event callback function.

    Methods

    Dispose(bool)

    Dispose unmanaged resources.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    Boolean value to dispose the object.

    Overrides
    OwningComponentBase.Dispose(bool)

    OnInitializedAsync()

    Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree. Override this method if you will perform an asynchronous operation and want the component to refresh when that operation is completed.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    Task

    A System.Threading.Tasks.Task representing any asynchronous operation.

    Overrides
    ComponentBase.OnInitializedAsync()

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved