This is a migrated thread and some comments may be shown as answers.

GridHyperLinkColumn - URL Issue

0 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Geoffrey
Top achievements
Rank 1
Geoffrey asked on 26 Jul 2012, 10:09 PM
I am using RadGrid with a GridHyperLinkColumn.  I am binding the grid on the client side.  When I use the hyperlink, it seems that the hreg in the generated <a tag is a reference to the local server.  This is not what is in the bound object.  I have an object, with a prperty "Url", Url has the value http://google.com

<telerik:GridHyperLinkColumn HeaderText="Preplan" DataTextField="Url" DataNavigateUrlFields="Url"
Target="_blank" DataNavigateUrlFormatString="{0}" HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Left" Visible="false" AllowFiltering="false" />

Above is the markup that I am using, however the output is this:

<a target="_blank" href="/mytestsite/Home/tabid/41/language/en-US/http://google.com">http://google.com</a>

I am using DotNetNuke 5.6 with version 2010.02.0929.35 of Telerik.Web.UI.dll

Given that the text is correct and looking @ the object in the debugger, the given data string is http://google.com, I can only assume that the control is adding the relative path...

what I find interesting is that if I change the DataNavigationUrlFormattingString in the markup to be DataNavigateUrlFormatString="http://google.com"  I get the expected result:
<a target="_blank" href="http://google.com">http://google.com</a>

Any thoughts on what I'm doing wrong?

An update:
It seems that if I use the property: DataNavigateUrlFormatString="http://{0}"

 

I get a different result, then I get either :  <a href="http:http://google.com" target="_blank">http://google.com</a> or <a href="http://google.com" target="_blank">http://google.com</a>
depending on the contents of the field, if it is http://google.com then you get the former, if it's google.com  then it's the latter.

 

 

 

 

 

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Geoffrey
Top achievements
Rank 1
Share this question
or