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.

How to place Hyperlink in grid column

Problem

How to place Hyperlink in grid column

Solution

We can place Hyperlink or any other controls inside grid cells 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.

Using template string

The template string will be provided during grid initialization as follows.

JS

 

MVC

 

 

ASPX

 

Perform action on clicking hyperlink

It is our sole responsibility to perform any action on clicking the link in the particular cell. For that we have to bind event to the hyperlink. But the hyperlink will be visible once the grid is render and so binding the event on DOM load is not sufficient. We can achieve this requirement using the Create event of the grid as follows.

 

The output will be also follows.

 

Article ID: Published Date: Last Revised Date: Platform: Control:
3768 02/09/2015 02/09/2015 ASP.NET Web Forms Grid
Did you find this information helpful?
Comments
santhosh May 04, 2017
How can I make the name of the hyperlink dynamic or assigned as the row values?

I want to make customer ID values as a hyperlink. Thanks in advance for the help.
Reply
Dhruv Shah Jul 30, 2017

exactly santhosh ...that is what I also want

if you found any solution please let me know


thanks !!

Reply
Dhruv Shah Jul 30, 2017

sorry, I found the solution with column template

 but please mention if there is any other way....because I want to make a common function for all link to be added at cell

Solution is : {{:NumeroFactura}}

thanks!


Pankaj Lakhera Jan 11, 2018

You can do like this:

Template="{{:CustomerID}}"

So instead of View, Particular customer ID will come.

Thanks

Logan Apr 30, 2018

I have this --


   

                                             

               

                                      

               

           


I want the role to load instead of the word "View" - when I do {{Role}}, my grid doesnt load any data at all

Reply
Sathyanarayanamoorthy Eswararao [Syncfusion] May 02, 2018

Hi Logan,

 

We have analzyzed your query and we suspect that you need to display the particular column data as hyperlink. In the provided code example the syntax for assigning values using template is given improperly (missed the colon)so the mentioned issue occurs. Please refer the below code example.

 

 

  <ej:Grid id="Grid" runat="server" AllowPaging="true">        

         <Columns>

             <ej:Column Field="OrderID"/>

             <ej:Column Field="CustomerID"/>                            

             <ej:Column HeaderText="Manage Records" Template=">{{:CustomerID}}" />            

         Columns>

         <ClientSideEvents Create="onGridCreate"/>

     ej:Grid>

 

 

We have prepared a sample for your convenience which can be downloaded from the below location.

 

Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/HyperLink-1103277838.zip

 

Regards,

Sathyanarayanamoorthy

Add Comment
You must log in to leave a comment

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.