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

  • 395
    posted

    Do all the hyperlinks point to the same page ????Devil... If not ....then use the initialize row ..event...

     

     

    Private Sub UltraWebGrid1_InitializeRow(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.RowEventArgs) Handles UltraWebGrid1.InitializeRow

    Try

    Dim rno As Integer

    Dim wfc As String = Nothing

    Me.ViewNo = Me.getvno 

    rno = Val(e.Row.Cells.FromKey("reqno").Text)   'saving the original value of the cell

    'Setup View Details

    Dim strViewDetailsURL As String = String.Empty

    Dim winWidth As Int16 = 0

    Dim winHeight As Int16 = 0

    If GetViewDetails(CShort(Me.ViewNo), strViewDetailsURL, winWidth, winHeight) = True Then   

     ' GetviewDetails function returns if there is a details page for this reqno along with the details like height and width of the modal

    e.Row.Cells.FromKey("subject").Text = "<a href=""#"" onClick=""OpenWindow('" & strViewDetailsURL & "', " & rno.ToString & ", " & winWidth & ", " & winHeight & ")"">" & e.Row.Cells.FromKey("subject").Text & "</a>"

    'update the value of the cell if details are supported

    End If

    Catch ex As Exception

    End Try

    End Sub

     

     Ps : So u can see the reqno will also act as an hyperlink to the viewdetails page. 

     

  • 769
    posted

    Here is another KB file that shows the example.

    http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=1383

     

    hs2

  • 769
    posted

    Hi Jayaram9,

     1. If you are using an ultrawebgrid hyperlink then this is what you need to do in order to assign a new page to the hyperlink:

    a. In the ultrawebgrid (Design HTML) you set the OnInitializeRow="ultrawebgrid1_InitializeRow"

    In your code behind(mine is C#), you need to call:

    protected void ultrawebgrid1_InitializeRow (object sender, RowEventArgs e){

    //if you want to pass any data to the newpage.aspx, then you need to collect the data from that row

    string col2Data = e.Row.Cells.FromKey("col2Data").Value.ToString();

     e.Row.Cells.FromKey("YOURHYPERLINKColumnName").TargetURL="newpage.aspx?col2Data="+col2Data

    }

     

    2. If you need to open up a modal then I would suggest you use this way

    http://forums.infragistics.com/forums/p/842/11844.aspx#11844

    with javascript http://www.eggheadcafe.com/articles/20050319.asp

     If you need more info, let me know!

    Good luck! 

    HS2