Hyperlink in a datatable

Joined
May 3, 2008
Messages
1
Reaction score
0
I am working on a web application. I am using IBM Universe database. My data comes in a complicated format thats why I save it to an array first and then I am creating a datatable so that I can bind it with my grid. Can you tell me how to make a datatable column a hyperlink. Following is not the actual code but logic is same
:
Dim id(2) As String
Dim desc(2) As String
'declaring an array
id(0) = "1"
id(1) = "2"
desc(0) = "Soccer"
desc(1) = "Cricket"
Dim dt As New Data.DataTable
Dim dr As Data.DataRow

Dim i As Integer
dt.Columns.Add(New Data.DataColumn("ID", GetType(String)))
dt.Columns.Add(New Data.DataColumn("Desc", GetType(String)))

For i = 0 To (id.Length - 1)

dr = dt.NewRow
dr("ID") = id(i)
dr("Desc") = desc(i)
dt.Rows.Add(dr)

Next

RadGrid1.DataSource = dt
RadGrid1.DataBind()

column "ID" has values in it, e.g. 1, 2, 3, etc., and I want the grid column to show hyperlinks, e.g. "order.aspx?id=1", "order.aspx?id=2", "order.aspx?id=3", etc. How do I do that. I have to use arrays. please help...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,048
Members
48,769
Latest member
Clifft

Latest Threads

Top