Articles in this section
Category / Section

How to add Hyperlink cell events in the PivotGrid

1 min read

We can add hyperlink cell events to any of the cells in the pivot grid. The following code explains the same.

C#

public UserControl1()
        {
            InitializeComponent();
            this.pivotGrid1.HyperlinkCellClick += new Syncfusion.Windows.Controls.PivotGrid.HyperlinkCellClick(pivotGrid1_HyperlinkCellClick);
        }
        private void pivotGrid1_HyperlinkCellClick(object sender, Syncfusion.Windows.Controls.PivotGrid.HyperlinkCellClickEventArgs e)
        {
            MessageBox.Show(e.PivotCellInfo.FormattedText, "Value");
        }
 
        private void Box_CheckedOrUncheked(object sender, RoutedEventArgs e)
        {
            CheckBox chkbox = sender as CheckBox;
            if (chkbox.IsChecked != null)
            {
                switch (chkbox.Name)
                {
                    case "ValueCellBox":
                        this.pivotGrid1.ValueCellStyle.IsHyperlinkCell = (bool)chkbox.IsChecked;
                        break;
                    case "ColumnHeaderCellBox":
                        this.pivotGrid1.ColumnHeaderCellStyle.IsHyperlinkCell = (bool)chkbox.IsChecked;
                        break;
                    case "RowHeaderCellBox":
                        this.pivotGrid1.RowHeaderCellStyle.IsHyperlinkCell = (bool)chkbox.IsChecked;
                        break;
                    case "SummaryCellBox":
                        this.pivotGrid1.SummaryCellStyle.IsHyperlinkCell = (bool)chkbox.IsChecked;
                        break;
                    case "SummaryHeaderSBox":
                        this.pivotGrid1.SummaryHeaderStyle.IsHyperlinkCell = (bool)chkbox.IsChecked;
                        break;
                }
            }
        }
    }

 

C:\Users\labuser\Dropbox\Screenshots\Screenshot 2014-06-05 17.49.25.png

Figure: Pivot Grid showing hyperlink cell

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied