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; } } } }
Figure: Pivot Grid showing hyperlink cell