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

radgrid GridHyperLinkColumn/ DataNavigateUrlFormatString

7 Answers 1666 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jessie
Top achievements
Rank 1
Jessie asked on 12 Jun 2009, 03:35 PM
I use GridHyperLinkColumn  on the radgrid, the grid has id, date, amount1, amount2 columns,
amount1 and amount2 columns are GridHyperLinkColumn, I want to click on amount1 columns but pass date and amount on the URL
if I set DataNavigateUrlFormatString="Detail.aspx?amount={0}", it will pass amount1 on the url, but not date, how I pass date on the URL when click on the amount1, since I want to go to a detailed screen for amount1 for the specific date (same for amount2 column).

Thanks,
Jessie

7 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 15 Jun 2009, 04:31 AM
Hi,

You can set the DataNavigateUrlFields property to as many datafields as you require and pass them as parameter to your DataNavigateUrlFormatString as shown below:

  <telerik:GridHyperLinkColumn FooterText="HyperLinkColumn footer" DataTextFormatString="Search Google for '{0}'" 
                        DataNavigateUrlFields="CustomerID,CompanyName" UniqueName="CompanyName" DataNavigateUrlFormatString="http://www.google.com/search?hl=en&amp;q={0}{1}&amp;btnG=Google+Search" 
                        HeaderText="HyperLink<br/>Column" DataTextField="CompanyName"
     </telerik:GridHyperLinkColumn> 


Here CustomerID and CompanyName are both passed as parameters.

Thanks,
Princy


0
Shinu
Top achievements
Rank 2
answered on 15 Jun 2009, 04:42 AM
Hi Jessie,

Try setting the DataNavigateUrlFields="Amount, Date" in order to pass both values through url and set the DataNavigateUrlFormatString as shown below.

ASPX:
 
<telerik:GridHyperLinkColumn DataTextField="amount" UniqueName="Link" DataNavigateUrlFields="Amount,Date" DataNavigateUrlFormatString="Export.aspx?amount={0}&date={1}"
</telerik:GridHyperLinkColumn> 

Thanks,
Shinu.
0
Amruta
Top achievements
Rank 1
answered on 18 Aug 2012, 03:23 PM
Hi
I am facing same problem and trying the same solution (using DataNavigateUrlFields) , but when I click on hyperlink it shows error 404 resource not found. when I hard code parameters without using DataNavigateUrlFields, i can successfully reach to the desired location. Please suggest something...

-Thanks
Amruta
0
Shinu
Top achievements
Rank 2
answered on 20 Aug 2012, 06:22 AM
Hi Amruta,

The Error 404 "Page not found" is the error page displayed whenever someone asks for a page that’s simply not available on your site. The reason for this is that there may be a link on your site that was wrong or the page might have been recently removed from the site. As there is no web page to display, the web server sends a page that simply says "404 Page not found".The code given above works fine if the url is given correctly.Here is a sample code i tried with the DataNavigateUrl to Google.Please try this and let me know if there is any concern.

ASPX:
<telerik:GridHyperLinkColumn DataTextField="OrderID" UniqueName="Link" DataNavigateUrlFields="OrderID,OrderDate" DataNavigateUrlFormatString="http://www.google.co.in/?OrderID={0}&OrderDate={1}">
</telerik:GridHyperLinkColumn>

Thanks,
Shinu.
0
Ahmet
Top achievements
Rank 1
answered on 08 Apr 2013, 02:00 PM
Thank you 
0
Kiran
Top achievements
Rank 1
answered on 29 Apr 2019, 05:21 PM

Hi,

Can anybody help we with this situation.

I have column, say "STATUS". This is brought in using sql server via XML Path. So, the column may be, "WIP" or "SUS, WIP" or "SUS,WIP, ATO" and so on. I want to make each part of the string a hyperlink. I mean make SUS a hyperlink, WIP a hyperlink and ATO a hyperlink. Basically making each part of the string a hyperlink based on the status. 

 

 

 

0
Eyup
Telerik team
answered on 01 May 2019, 09:27 AM
Hi Kiran,

I've already replied regarding this case in your formal support ticket. I suggest that we continue our discussion in the mentioned thread and suggest that you keep your similar questions in one single place so we can track them better and reply accordingly.

Nevertheless, I will also copy the approach here:

You can use the following approach:
Copy Code
gridItem("ShipCountry").Text = String.Format(
    "<a style='color: {0};' href='javascript:void(0);' onclick='showWindow(this);'>{1}</a>",
    typeColor.Value, text)

JavaScript:
Copy Code
function showWindow(link) {
    radalert("Window for " + $(link).text());
}

Alternatively, you can call the following line instead of radalert:
Copy Code
$find('<%= RadWindow1.ClientID %>').show();


Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Jessie
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Amruta
Top achievements
Rank 1
Ahmet
Top achievements
Rank 1
Kiran
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or