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.
Syncfusion Feedback

Grid Row as a link

Thread ID:

Created:

Updated:

Platform:

Replies:

131355 Jul 6,2017 07:46 AM UTC Jul 10,2017 06:44 PM UTC ASP.NET MVC 3
loading
Tags: Grid
John
Asked On July 6, 2017 07:47 AM UTC

Good day!Can I bind go to some generated Url (for example: @Action.Url("GetFileInfo", "Files", {{:FileID}})) when user clicks on Grid row

Prasanna Kumar Viswanathan [Syncfusion]
Replied On July 7, 2017 03:26 PM UTC

Hi John, 

Thanks for contacting Syncfusion support. 

Before we proceed with your query, we need some clarifications. 

1. Do you need to bind Generated URL for particular column or row?. If you need to place the hyperlink in grid cells, use the below KnowledgeBase documentation.  


2. According to your query when you click on the row you need to move to the generated URL with value of any of the column. 

3. Share the screenshot of your requirement.   

Regards, 
Prasanna Kumar N.S.V 


John
Replied On July 8, 2017 06:33 AM UTC

Hi, Prasanna Kumar N.S.V !

I need to bind generated url to row in Grid, every row have a unique url, but url generating pattern is the same @Action.Url("GetFileInfo", "Files", {{:FileID}}) and only FileID property changes in every row url.

You're right, I you need to move to the generated URL with value of any of the column when I click on the row


Prasanna Kumar Viswanathan [Syncfusion]
Replied On July 10, 2017 06:44 PM UTC

Hi John, 

Thanks for the update. 

To achieve your requirement, use rowTemplate feature of ejGrid. Row template enables you to set the customized look and behavior to grid all rows. Using rowTemplate feature we bind the generated url row to Grid. When we click on the row it will move to the generated URL with the value of an column. 
 
Find the code example and sample:  
 

@(Html.EJ().Grid<object>("HierarchyGrid") 
     .Datasource((IEnumerable<object>)ViewBag.datasource) 
     
     .AllowPaging() 
     .RowTemplate("#templateData") 
     .Columns(col => 
      { 
          col.HeaderText("Photo").Width(10).Add(); 
               
      }) 
) 
 
 
<script id="templateData" type="text/x-jsrender"> 
    <tr> 
         
        <td class="details"> 
            <table class="CardTable" cellpadding="3" cellspacing="2"> 
                <colgroup> 
                    <col width="10"> 
                   
                </colgroup> 
                <tbody>                 
                    <tr> 
                        <td> 
                            <a rel='nofollow' href="/Grid/RowTemplate?OrderID={{:EmployeeID}}">EmployeeID</a> 
                        </td> 
                    </tr> 
                </tbody> 
            </table> 
        </td> 
    </tr> 
</script> 


Refer to the Help document for the rowTemplate. 


If we misunderstood your query, please get back to us. 

Regards, 
Prasanna Kumar N.S.V 


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.

Warning Icon 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.Close Icon

;