Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set GridView column as a hyperlink?

Status
Not open for further replies.

Curtis360it

IS-IT--Management
Nov 7, 2005
88
0
0
US
How can I make a column in my GridView a hyperlink if the GridView doesn't have a datasource until runtime?
 
I do but the the program won't know until runtime.
 
What I actually ended up doing was creating the hyperlink at the begining of each row on the GridView1_RowDataBound event.

Dim h1 As New HyperLink()
Dim DocPath As String

If e.Row.Cells(0).Text <> "document_uid" And e.Row.Cells(0).Text <> "&nbsp;" Then
DocPath = PopulateURL(e.Row.Cells(0).Text)
h1.Text = e.Row.Cells(1).Text
h1.NavigateUrl = DocPath
End If

e.Row.Cells(1).Controls.Add(h1)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top