Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
WinGrid Cell Hyperlink to show the browser when i click on the link only.
posted

Hello All,

I am using a UltraWinGrid and i  have implemented  one cell of the grid to show email addresses as hyperlink .Problem is that when i click any where

in the cell it opens an outlook instance for me i want it should open the  outlook only when i click on the email address not when i click any where in the cell (which may be the empty region left after the email address) for e.g *Prabhatc@cybage.com          * here i want outlook to open when i click

onthe email address not when i click on the empty region of the cell .I am using this code.

 

 Private Sub ContactsUltraGrid_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ContactsUltraGrid.MouseDown
        'Implemented functionality on left click of mouse
        Dim mousePoint As System.Drawing.Point = New System.Drawing.Point(e.X, e.Y)
        Dim element As Infragistics.Win.UIElement = CType(sender, Infragistics.Win.UltraWinGrid.UltraGrid).DisplayLayout.UIElement.ElementFromPoint(mousePoint)
        Dim cell As Infragistics.Win.UltraWinGrid.UltraGridCell = CType(element.GetContext(GetType(Infragistics.Win.UltraWinGrid.UltraGridCell)), Infragistics.Win.UltraWinGrid.UltraGridCell)
        If cell Is Nothing Then Return
        If e.Button = System.Windows.Forms.MouseButtons.Left Then

            'Here we figure out whether we have clicked on email link if yes then open outlook
            If cell.Column.Key = "Email" Then
                Dim strEmail As String = cell.Tag.ToString()
                If (strEmail.Trim().Length > 0) Then
                    strEmail = "MailTo:" & strEmail
                    'Open OutLook
                    System.Diagnostics.Process.Start(strEmail)
                End If
  
           End If
        End If
    End Sub

 

 

Please respond me..

Thanks a Lot,

Regards,

Prabhat Chauhan