radgrid GridHyperLinkColumn/ DataNavigateUrlFormatString

8 posts, 0 answers
  1. Jessie
    Jessie avatar
    12 posts
    Member since:
    Jun 2006

    Posted 12 Jun 2009 Link to this post

    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

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 14 Jun 2009 Link to this post

    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


  3. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Jun 2009 Link to this post

    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.
  4. Amruta
    Amruta avatar
    1 posts
    Member since:
    Aug 2012

    Posted 18 Aug 2012 Link to this post

    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
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 20 Aug 2012 Link to this post

    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.
  6. Ahmet
    Ahmet avatar
    1 posts
    Member since:
    Jul 2012

    Posted 08 Apr 2013 Link to this post

    Thank you 
  7. Kiran
    Kiran  avatar
    43 posts
    Member since:
    Oct 2018

    Posted 29 Apr Link to this post

    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. 

     

     

     

  8. Eyup
    Admin
    Eyup avatar
    3867 posts

    Posted 01 May Link to this post

    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.
Back to Top