Search results

Hyperlink

The pivot table supports to show hyperlink option to link data for individual cells that are displayed in the component. Also, the hyperlink can be enabled separately for row headers, column headers, value cells, and summary cells using the PivotViewHyperlinkSettings class. It can be configured through code behind, during initial rendering and the settings available to show hyperlink are:

By default, the hyperlink options are disabled for all cells in the pivot table.

User defined style can be applied to hyperlink using CssClass property in PivotViewHyperlinkSettings class.

The pivot table has an option to show hyperlink option for all cells that are currently in display. To do so, user need to set ShowHyperlink to true.

    @using Syncfusion.EJ2.Blazor.PivotViews

    <EjsPivotView TValue="ProductDetails" ShowFieldList="true">
        <PivotViewDataSourceSettings DataSource="@data">
            <PivotViewColumns>
                <PivotViewColumn Name="Year"></PivotViewColumn>
                <PivotViewColumn Name="Quarter"></PivotViewColumn>
            </PivotViewColumns>
            <PivotViewRows>
                <PivotViewRow Name="Country"></PivotViewRow>
                <PivotViewRow Name="Products"></PivotViewRow>
            </PivotViewRows>
            <PivotViewValues>
                <PivotViewValue Name="Amount" Caption="Sold Amount"></PivotViewValue>
            </PivotViewValues>
        </PivotViewDataSourceSettings>
        <PivotViewHyperlinkSettings ShowHyperlink="true" CssClass="e-custom-class">
        </PivotViewHyperlinkSettings>
    </EjsPivotView>

<style>
    .e-custom-class,.e-custom-class:hover {
        text-decoration: underline !important;
    }
    .e-custom-class:hover {
        color: red !important;
    }
</style>
    @code{
        public List<ProductDetails> data { get; set; }
        protected override void OnInitialized()
        {
            this.data = ProductDetails.GetProductData().ToList();
           //Bind the data source collection here. Refer "Assigning sample data to the pivot table" section in getting started for more details.
        }
    }

output

The pivot table has an option to show hyperlink option for row header cells alone that are currently in display. To do so, user need to set ShowRowHeaderHyperlink to true.

    @using Syncfusion.EJ2.Blazor.PivotView

    <EjsPivotView TValue="ProductDetails">
        <PivotViewDataSourceSettings DataSource="@data">
            <PivotViewColumns>
                <PivotViewColumn Name="Year"></PivotViewColumn>
                <PivotViewColumn Name="Quarter"></PivotViewColumn>
            </PivotViewColumns>
            <PivotViewRows>
                <PivotViewRow Name="Country"></PivotViewRow>
                <PivotViewRow Name="Products"></PivotViewRow>
            </PivotViewRows>
            <PivotViewValues>
                <PivotViewValue Name="Amount" Caption="Sold Amount"></PivotViewValue>
            </PivotViewValues>
        </PivotViewDataSourceSettings>
        <PivotViewHyperlinkSettings ShowRowHeaderHyperlink="true" CssClass="e-custom-class">
        </PivotViewHyperlinkSettings>
    </EjsPivotView>

<style>
    .e-custom-class,.e-custom-class:hover {
        text-decoration: underline !important;
    }
    .e-custom-class:hover {
        color: red !important;
    }
</style>
    @code{
        public List<ProductDetails> data { get; set; }
        protected override void OnInitialized()
        {
            this.data = ProductDetails.GetProductData().ToList();
           //Bind the data source collection here. Refer "Assigning sample data to the pivot table" section in getting started for more details.
        }
    }

output

The pivot table has an option to show hyperlink option for column header cells alone that are currently in display. To do so, user need to set ShowColumnHeaderHyperlink to true.

    @using Syncfusion.EJ2.Blazor.PivotView

    <EjsPivotView TValue="ProductDetails">
        <PivotViewDataSourceSettings DataSource="@data">
            <PivotViewColumns>
                <PivotViewColumn Name="Year"></PivotViewColumn>
                <PivotViewColumn Name="Quarter"></PivotViewColumn>
            </PivotViewColumns>
            <PivotViewRows>
                <PivotViewRow Name="Country"></PivotViewRow>
                <PivotViewRow Name="Products"></PivotViewRow>
            </PivotViewRows>
            <PivotViewValues>
                <PivotViewValue Name="Amount" Caption="Sold Amount"></PivotViewValue>
            </PivotViewValues>
        </PivotViewDataSourceSettings>
            <PivotViewHyperlinkSettings ShowColumnHeaderHyperlink="true" CssClass="e-custom-class">
            </PivotViewHyperlinkSettings>
    </EjsPivotView>

<style>
    .e-custom-class,.e-custom-class:hover {
        text-decoration: underline !important;
    }
    .e-custom-class:hover {
        color: red !important;
    }
</style>
    @code{
        public List<ProductDetails> data { get; set; }
        protected override void OnInitialized()
        {
            this.data = ProductDetails.GetProductData().ToList();
           //Bind the data source collection here. Refer "Assigning sample data to the pivot table" section in getting started for more details.
        }
    }

output

The pivot table has an option to show hyperlink option for value cells alone that are currently in display. To do so, user need to set ShowValueCellHyperlink to true.

    @using Syncfusion.EJ2.Blazor.PivotView

    <EjsPivotView TValue="ProductDetails">
        <PivotViewDataSourceSettings DataSource="@data" ExpandAll="true">
            <PivotViewColumns>
                <PivotViewColumn Name="Year"></PivotViewColumn>
                <PivotViewColumn Name="Quarter"></PivotViewColumn>
            </PivotViewColumns>
            <PivotViewRows>
                <PivotViewRow Name="Country"></PivotViewRow>
                <PivotViewRow Name="Products"></PivotViewRow>
            </PivotViewRows>
            <PivotViewValues>
                <PivotViewValue Name="Amount" Caption="Sold Amount"></PivotViewValue>
            </PivotViewValues>
        </PivotViewDataSourceSettings>
            <PivotViewHyperlinkSettings ShowValueCellHyperlink="true" CssClass="e-custom-class">
            </PivotViewHyperlinkSettings>
    </EjsPivotView>

<style>
    .e-custom-class,.e-custom-class:hover {
        text-decoration: underline !important;
    }
    .e-custom-class:hover {
        color: red !important;
    }
</style>
    @code{
        public List<PivotViewData.DefaultData> data { get; set; }
        protected override void OnInitialized()
        {
            this.data = PivotViewData.GetDefaultData().ToList();
           //Bind the data source collection here. Refer "Assigning sample data to the pivot table" section in getting started for more details.
        }
    }

output

The pivot table has an option to show hyperlink option for summary cells alone that are currently in display. To do so, user need to set ShowSummaryCellHyperlink to true.

    @using Syncfusion.EJ2.Blazor.PivotView

    <EjsPivotView TValue="ProductDetails">
        <PivotViewDataSourceSettings DataSource="@data" ExpandAll="true">
            <PivotViewColumns>
                <PivotViewColumn Name="Year"></PivotViewColumn>
                <PivotViewColumn Name="Quarter"></PivotViewColumn>
            </PivotViewColumns>
            <PivotViewRows>
                <PivotViewRow Name="Country"></PivotViewRow>
                <PivotViewRow Name="Products"></PivotViewRow>
            </PivotViewRows>
            <PivotViewValues>
                <PivotViewValue Name="Amount" Caption="Sold Amount"></PivotViewValue>
            </PivotViewValues>
        </PivotViewDataSourceSettings>
            <PivotViewHyperlinkSettings ShowSummaryCellHyperlink="true" CssClass="e-custom-class">
            </PivotViewHyperlinkSettings>
    </EjsPivotView>

<style>
    .e-custom-class,.e-custom-class:hover {
        text-decoration: underline !important;
    }
    .e-custom-class:hover {
        color: red !important;
    }
</style>
    @code{
        public List<PivotViewData.DefaultData> data { get; set; }
        protected override void OnInitialized()
        {
            this.data = PivotViewData.GetDefaultData().ToList();
           //Bind the data source collection here. Refer "Assigning sample data to the pivot table" section in getting started for more details.
        }
    }

output

The pivot table has an option to show hyperlink in the cells based on specific conditions. It can be configured using the PivotViewConditionalSettings class through code behind, during initial rendering. The settings required are:

    @using Syncfusion.EJ2.Blazor.PivotView

    <EjsPivotView TValue="ProductDetails">
        <PivotViewDataSourceSettings DataSource="@data" ExpandAll="true">
            <PivotViewColumns>
                <PivotViewColumn Name="Year"></PivotViewColumn>
                <PivotViewColumn Name="Quarter"></PivotViewColumn>
            </PivotViewColumns>
            <PivotViewRows>
                <PivotViewRow Name="Country"></PivotViewRow>
                <PivotViewRow Name="Products"></PivotViewRow>
            </PivotViewRows>
            <PivotViewValues>
                <PivotViewValue Name="Amount" Caption="Sold Amount"></PivotViewValue>
            </PivotViewValues>
        </PivotViewDataSourceSettings>
        <PivotViewHyperlinkSettings CssClass="e-custom-class">
            <PivotViewConditionalSettings>
                <PivotViewConditionalSetting Measure="Sold" Conditions=Condition.Between Value1="100" Value2="200"></PivotViewConditionalSetting>
            </PivotViewConditionalSettings>
        </PivotViewHyperlinkSettings>
    </EjsPivotView>

<style>
    .e-custom-class,.e-custom-class:hover {
        text-decoration: underline !important;
    }
    .e-custom-class:hover {
        color: red !important;
    }
</style>
    @code{
        public List<PivotViewData.DefaultData> data { get; set; }
        protected override void OnInitialized()
        {
            this.data = PivotViewData.GetDefaultData().ToList();
           //Bind the data source collection here. Refer "Assigning sample data to the pivot table" section in getting started for more details.
        }
    }

output

The pivot table has an option to show hyperlink in the cells based on specific row or column header. It can be configured using the HeaderText option through code behind, during initial rendering.

    @using Syncfusion.EJ2.Blazor.PivotView

    <EjsPivotView TValue="ProductDetails">
        <PivotViewDataSourceSettings DataSource="@data">
            <PivotViewColumns>
                <PivotViewColumn Name="Year"></PivotViewColumn>
                <PivotViewColumn Name="Quarter"></PivotViewColumn>
            </PivotViewColumns>
            <PivotViewRows>
                <PivotViewRow Name="Country"></PivotViewRow>
                <PivotViewRow Name="Products"></PivotViewRow>
            </PivotViewRows>
            <PivotViewValues>
                <PivotViewValue Name="Amount" Caption="Sold Amount"></PivotViewValue>
            </PivotViewValues>
        </PivotViewDataSourceSettings>
        <PivotViewHyperlinkSettings HeaderText="FY 2015" CssClass="e-custom-class"></PivotViewHyperlinkSettings>
    </EjsPivotView>

<style>
   .e-custom-class,.e-custom-class:hover {
        text-decoration: underline !important;
    }
    .e-custom-class:hover {
        color: red !important;
    }
</style>

    @code{
        public List<PivotViewData.DefaultData> data { get; set; }
        protected override void OnInitialized()
        {
            this.data = PivotViewData.GetDefaultData().ToList();
           //Bind the data source collection here. Refer "Assigning sample data to the pivot table" section in getting started for more details.
        }
    }

output

Event

The event HyperlinkCellClicked fires on every hyperlink cell click.

It has following parameters - Cancel and CurrentCell. The parameter CurrentCell is used to customize the host cell element by any means. Meanwhile, when the parameter Cancel is set to true, applied customization will not be updated to the host cell element.

    @using Syncfusion.EJ2.Blazor.PivotViews

    <EjsPivotView TValue="ProductDetails" ShowFieldList="true">
        <PivotViewDataSourceSettings DataSource="@data">
            <PivotViewColumns>
                <PivotViewColumn Name="Year"></PivotViewColumn>
                <PivotViewColumn Name="Quarter"></PivotViewColumn>
            </PivotViewColumns>
            <PivotViewRows>
                <PivotViewRow Name="Country"></PivotViewRow>
                <PivotViewRow Name="Products"></PivotViewRow>
            </PivotViewRows>
            <PivotViewValues>
                <PivotViewValue Name="Amount" Caption="Sold Amount"></PivotViewValue>
            </PivotViewValues>
        </PivotViewDataSourceSettings>
        <PivotViewHyperlinkSettings ShowHyperlink="true" CssClass="e-custom-class">
        </PivotViewHyperlinkSettings>
        <PivotViewEvents TValue="ProductDetails"  HyperlinkCellClicked="hyperlink"></PivotViewEvents>
    </EjsPivotView>

<style>
    .e-custom-class,.e-custom-class:hover {
        text-decoration: underline !important;
    }
    .e-custom-class:hover {
        color: red !important;
    }
</style>
    @code{
        public List<ProductDetails> data { get; set; }
        protected override void OnInitialized()
        {
            this.data = ProductDetails.GetProductData().ToList();
           //Bind the data source collection here. Refer "Assigning sample data to the pivot table" section in getting started for more details.
        }
        public void hyperlink(HyperCellClickEventArgs args)
        {
            args.Cancel = false;
            args.CurrentCell.SetAttribute("data-url", "https://ej2.syncfusion.com/");//here we have redirected to EJ2 Syncfusion on hyperlinkcell click
        }
    }