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

Grid with hyperlink to an image

3 Answers 710 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vincent
Top achievements
Rank 1
Vincent asked on 08 Sep 2016, 08:55 PM

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>

3 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 12 Sep 2016, 10:28 AM
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
0
Vincent
Top achievements
Rank 1
answered on 12 Sep 2016, 05:09 PM

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.

 

0
Konstantin Dikov
Telerik team
answered on 14 Sep 2016, 11:50 AM
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
Tags
Grid
Asked by
Vincent
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Vincent
Top achievements
Rank 1
Share this question
or