Grid with hyperlink to an image

4 posts, 0 answers
  1. JIM
    JIM avatar
    2 posts
    Member since:
    Sep 2012

    Posted 08 Sep Link to this post

    What is the correct way to have a column in a Telerik MVC Razor page that contains a link for a person to click and view an image in another window?

     

    The images will be on a network directory share.  

    Each row image location is passed in the data view model.

     

    Something like <a href = "file://///ccijisdevbt01m\d$\pictures\Graffiti_London.jpg" target="_blank"> Link to image </a>

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1800 posts

    Posted 12 Sep Link to this post

    Hi Jim,

    If you are binding your Grid with AJAX you can define custom template for the column through its ClientTemplate:
    .Columns(columns =>
    {
        columns.Bound(p => p.Title).ClientTemplate("<strong>#: Title #</strong>");

    You can refer to the following help topic for additional information:
    Hope this helps.


    Regards,
    Konstantin Dikov
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. JIM
    JIM avatar
    2 posts
    Member since:
    Sep 2012

    Posted 12 Sep in reply to Konstantin Dikov Link to this post

    Can you give me a client template sample  that will allow a person to clink on a href that links to image on a network share?

    The location will be in a field in the model.

     

  5. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1800 posts

    Posted 14 Sep Link to this post

    Hello Jim,

    You should use something as the line below, but :
    .ClientTemplate("<a href = 'file://///" + "#:ImageUrlField#" + "' target='_blank'> Link to image </a>")

    You can also take a look at the following forum threads:
    Hope this helps.


    Regards,
    Konstantin Dikov
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET MVC is VS 2017 Ready