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...
:
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...