We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Hyperlink based on another cell

Thread ID:

Created:

Updated:

Platform:

Replies:

120871 Oct 23,2015 08:54 AM Oct 27,2015 12:09 AM ASP.NET MVC 3
loading
Tags: Grid
Prasanth
Asked On October 23, 2015 08:54 AM

Hi there,

I am trying to add a column/cell at the end of the grid columns to provide a hyperlink based on let's say ID of the record (e.g "<a rel='nofollow' href='/Project?ProjectID=1'>Details</a>")

I have seen few posts regarding links within Grid, but unable to put something together, any assistance on this would be highly appreciated.

I am using MVC 5 / syncfusion version 13.3.0.7

Regards
Prasanthan

Alan Sangeeth S [Syncfusion]
Replied On October 26, 2015 01:28 AM

Hi Prasanthan,

Thanks for using Syncfusion products.


We can place Hyperlink in a Grid column using the Column template feature of the grid. The template to a particular column can be provided by using Template and TemplateID properties of the column. Please refer the following code snippets.

@(Html.EJ().Grid<object>("ColumnTemplate")


.Columns(col =>

        {

col.Field("OrderID").HeaderText("Order ID").Width(90).Add();

             

col.HeaderText("Employee HyperLink").Template(true).TemplateID("#columnTemplate")       .TextAlign(TextAlign.Center).Width(110).Add();

           

        })

)


<script type="text/x-jsrender" id="columnTemplate">

  @*In the template column we can get the values of corresponding row.*@

    <a rel='nofollow' href='/Project/?Id={{:OrderID}}'> Details</a>

</script>



For your convenience we have created a sample that can be downloadable from the following link.

Sample: http://www.syncfusion.com/downloads/support/forum/120871/ze/EJGrid295300443

Regards,
Alan Sangeeth S

Prasanth
Replied On October 26, 2015 02:48 AM

Hi Alan

Thanks for that :-) will try it and if there are any issues will post a message

Regards
Prasanthan

Saravanan Arunachalam [Syncfusion]
Replied On October 27, 2015 12:09 AM

Hi Prasanthan,

Thanks for your update.          

We will wait to hear from you.

Regards,

Saravanan A.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;