How to add hyperlink to an ultragrid column
where the link directs to new page consisting of the data related to tha ID
Do all the hyperlinks point to the same page ????... If not ....then use the initialize row ..event...
Try
Dim rno As Integer
Dim wfc As String = Nothing
rno = Val(e.Row.Cells.FromKey("reqno").Text) 'saving the original value of the cell
'Setup View Details
Dim winWidth 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
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.
Here is another KB file that shows the example.
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=1383
hs2
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