3 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 06 Jul 2010, 11:02 AM
Hello Steven,
In order to achieve this, set the DataNavigateUrlFields property of GridHyperLinkColumn. You can then combine the navigate URL fields by specifying a format string as the value of the DataNavigateUrlFormatString property. Please refer the section "GridHyperLinkColumn" in the following documentation which explains the same.
Column types
Thanks,
Princy.
In order to achieve this, set the DataNavigateUrlFields property of GridHyperLinkColumn. You can then combine the navigate URL fields by specifying a format string as the value of the DataNavigateUrlFormatString property. Please refer the section "GridHyperLinkColumn" in the following documentation which explains the same.
Column types
Thanks,
Princy.
0

Steven
Top achievements
Rank 1
answered on 06 Jul 2010, 11:18 AM
Hi Princy,
Sorry I don't think I was clear in my original request. I have an existing variable on the URL called 'db' I need to include this on the link.
This is what I have currently but I need to append this with the existing variable from the URL, I thought I may have been able to edit the DataNavigateURLFields by doing something like:
but this just errors out.
Sorry I don't think I was clear in my original request. I have an existing variable on the URL called 'db' I need to include this on the link.
<telerik:GridHyperLinkColumn |
DataNavigateUrlFields="ProjectKey, LocationKey" |
DataNavigateUrlFormatString="../Recruitment-data.aspx?projectid={0}&locationid={1}" |
UniqueName="InvestigatorSelect" |
Text="Select" |
Visible="False" |
target="_top"> |
</telerik:GridHyperLinkColumn> |
This is what I have currently but I need to append this with the existing variable from the URL, I thought I may have been able to edit the DataNavigateURLFields by doing something like:
DataNavigateUrlFormatString="../Recruitment-data.aspx?projectid={0}&locationid={1}<%# iif(len(request.querystring("db")) > 0, "&db=" & request.querystring("db"), "") %>" |
but this just errors out.
0
Accepted

Princy
Top achievements
Rank 2
answered on 07 Jul 2010, 10:53 AM
Hello Steven,
You can achieve this from code behind. In ItemDataBound event access the HyperLink control and set its NavigateUrl property accordingly.
ASPX:
VB.NET:
Thanks,
Princy.
You can achieve this from code behind. In ItemDataBound event access the HyperLink control and set its NavigateUrl property accordingly.
ASPX:
<telerik:GridHyperLinkColumn UniqueName="InvestigatorSelect" Text="Select" Visible="true" Target="_top"> |
VB.NET:
Protected Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs) |
If TypeOf e.Item Is GridDataItem Then |
Dim item As GridDataItem = DirectCast(e.Item, GridDataItem) |
Dim rowView As DataRowView = DirectCast(item.DataItem, DataRowView) |
Dim id As String = rowView("ProjectKey").ToString() |
Dim name As String = rowView("LocationKey").ToString() |
Dim link As HyperLink = DirectCast(item("InvestigatorSelect").Controls(0), HyperLink) |
Dim v As String = Request.QueryString("db").ToString() |
If v.Length > 0 Then |
db = v |
Else |
db = "" |
End If |
link.NavigateUrl = "../Recruitment-data.aspx?projectid={0}&locationid={1}" & "db=" & db |
End If |
End Sub |
Thanks,
Princy.