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
65
hyperlink in ultragrid view
posted

How to add hyperlink to an ultragrid column

where the link directs to new page consisting of the data related to tha ID

Parents
No Data
Reply
  • 280
    posted

    i m vb.net developer and i add hyper link in ultra grid in this way

    Private Sub UltraGrid1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles UltraGrid1.MouseDown
    Dim objClickedElement As UIElement = Me.UltraGrid1.DisplayLayout.UIElement.ElementFromPoint(UltraGrid1.PointToClient(Form1.MousePosition))

    If objClickedElement Is Nothing Then Return

    Dim objCellElement As CellUIElement = objClickedElement.GetAncestor(GetType(Infragistics.Win.UltraWinGrid.CellUIElement))

    If objCellElement Is Nothing Then Return

    Dim objCell As UltraGridCell = CType(objCellElement.GetContext(GetType(UltraGridCell)), UltraGridCell)

    If objCell Is Nothing Then Return
    '/////////////name here as key/////////////
    If objCell.Column.Key = "name" Then
    System.Diagnostics.Process.Start(objCell.Tag.ToString)
    End If
    '/////hyper link code is there and some part is above is end there//////////
    End Sub

    Private Sub UltraGrid1_InitializeRow(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) Handles UltraGrid1.InitializeRow

    '///////////////part for add hyperlink in ultragrid///////////////

     e.Row.Cells(1).Tag = "http://www.google.com/search?hl=en&q=" + e.Row.Cells(2).Value.ToString.Replace(" ", "+")
    End Sub

     Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout

    '//////////////////FOR ADD VALUE LIST CODE IS END HERE
    e.Layout.Bands(0).Columns(1).CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly
    e.Layout.Bands(0).Columns(1).CellAppearance.ForeColor = Color.Blue
    e.Layout.Bands(0).Columns(1).CellAppearance.FontData.Underline = Infragistics.Win.DefaultableBoolean.True
    e.Layout.Bands(0).Columns(1).CellAppearance.Cursor = Cursors.Hand
    End Sub

    hope that code will help u

    if u have more issue about ultragrid please visit that link

    http://ahmadkhalid44.blogspot.com/

    Regards:

    Ahmad khalid

Children
No Data