We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Code example for HyperlinkCellClick

Good Morning:

Could you show me an example to use the HyperlinkCellClick event on VB.net for the PivotGrid control?

Thanks in advance. Carlos

3 Replies

AA Arulraj A Syncfusion Team March 15, 2019 01:28 AM

Hi Carlos, 

Thanks for using Syncfusion product. 

You can achieve your requirement by setting the cell type as HyperlinkCell. HyperlinkCellClick event raised when the hyperlink cell gets clicked in the pivot grid control. This event receives an argument HyperlinkCellClickEventArgs, that contains the information about the hyperlink cell which is clicked. 


        Public Sub New() 
            AddHandler Me.pivotGridControl1.TableModel.QueryCellInfo, AddressOf TableModel_QueryCellInfo 
            AddHandler Me.pivotGridControl1.TableControl.HyperlinkCellClick, AddressOf TableControl_HyperlinkCellClick 
        End Sub 

        Private Sub TableModel_QueryCellInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs) 
            If e.RowIndex > Me.pivotGridControl1.PivotColumns.Count + (If(Me.pivotGridControl1.PivotCalculations.Count > 1, 1, 0)) AndAlso e.ColIndex > Me.pivotGridControl1.PivotRows.Count AndAlso e.Style.CellValue IsNot Nothing Then 
                e.Style.CellType = If(Me.checkBox1.Checked, "HyperlinkCell", "TextBox") 
                e.Style.Tag = Nothing 
            End If 
        End Sub 

        Private Sub TableControl_HyperlinkCellClick(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.PivotAnalysis.HyperlinkCellClickEventArgs) 
            If Me.checkBox1.Checked Then 
                Dim cellInfo As PivotCellInfo = Me.pivotGridControl1.PivotEngine(e.PivotCellInfo.RowIndex - 1, e.PivotCellInfo.ColumnIndex - 1) 
                Dim styeInfo As GridStyleInfo = Me.pivotGridControl1.TableModel(e.PivotCellInfo.RowIndex, e.PivotCellInfo.ColumnIndex) 
                Dim row As String = "Row index " & e.PivotCellInfo.RowIndex 
                Dim column As String = "Column index " & e.PivotCellInfo.ColumnIndex 
                Dim cellValue As String = "Cell value " & cellInfo.FormattedText 
                MessageBox.Show(row & vbCrLf & column & vbCrLf & cellValue) 
            End If 
        End Sub 

Please refer our UG documentation from the following link: 

Please let us know if you need any further assistance. 

Arulraj A 

CA Carlos March 15, 2019 04:19 AM

Thanks Arulraj for the code example but unfortunately it does not work. When you click on a cell with a hyperlink, open the Internet Explorer and TableControl_HyperlinkCellClick event is not raised.



AA Arulraj A Syncfusion Team March 18, 2019 07:36 AM

Hi Carlos,    
Sorry for the inconvenience caused. 
We have merged the reported issue “Browser windows opens while clicking the hyperlink cells” in your reported version 
Please find the patch file from the following location:    
Recommended approach – exe will perform automatic configuration         
Please find the patch setup here:                               
Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment                          
Please find the patch assemblies alone from:          
Please find the Nugets from the below location:         
You can change how you receive bug fixes by navigating to the following link and updating your preferences.
Please note that we have created this patch for the version specifically to resolve the issues reported in this forum #143334. If you have received other patches for the same version for other products, please apply all patches in the order received. 

Arulraj A 

Live Chat Icon For mobile
Up arrow icon