Client template (hyper link) on Foreign Key column

6 posts, 1 answers
  1. Nirav
    Nirav avatar
    17 posts
    Member since:
    Mar 2013

    Posted 09 Apr 2013 Link to this post

    Hi,

    I want to apply hyperlink on foreign key column.
    I am having a products foreign key column in my grid. During add/edit popup mode user can select the product from dropdown list. Once user adds the data I am displaying product name in my grid.

    Now I want to display the product name as a link and clicking on it, user should navigate to product details page.

    Thanks,
    Nirav
  2. Answer
    Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2204 posts

    Posted 11 Apr 2013 Link to this post

    Hi Nirav,

     
    Basically in the client template only the value of the column is available and you should manually match the text for that value to show it in the hyper link. For convenience I created small example about how to achieve the desired behavior using custom code and attached it to the current thread.

    Kind Regards,
    Vladimir Iliev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Nirav
    Nirav avatar
    17 posts
    Member since:
    Mar 2013

    Posted 12 Apr 2013 Link to this post

    Hi Vladimir,

    Your example worked like a charmed. This is what I needed and thanks for providing the same.

    Regards,
    Nirav
  4. Amitkumar
    Amitkumar avatar
    7 posts
    Member since:
    Mar 2014

    Posted 10 Apr 2014 in reply to Vladimir Iliev Link to this post

    Hi Vladimir,

    I need one simple hyperlink column which is simple coming from database....

    How can achieve that? Here is my code and Grid attachment.


    columns.Bound(Docs =>Docs.docid );
    columns.Bound(Docs => Docs.filename);
    columns.Bound(Docs => Docs.SvcUrl); //This column I wanted to make it hyperlink will open in new window.


  5. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2204 posts

    Posted 14 Apr 2014 Link to this post

    Hi,

    Please check the example below of creating a link from the "SvcUrl" property:

    columns.Bound(Docs => Docs.SvcUrl)
        .ClientTemplate(" <a href='#=SvcUrl#' target='_blank'>Click Here</a> ");

    Regards,
    Vladimir Iliev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Amitkumar
    Amitkumar avatar
    7 posts
    Member since:
    Mar 2014

    Posted 15 Apr 2014 in reply to Vladimir Iliev Link to this post

    Can you please delete the hyperlink image? Thanks,
Back to Top