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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Tree Grid, Need a button on every row, to view the record i.e to navigate to another page.

Thread ID:





123344 Mar 9,2016 05:47 AM UTC Mar 10,2016 06:55 AM UTC ASP.NET Web Forms 1
Tags: TreeGrid
Asked On March 9, 2016 05:47 AM UTC


Actually, trying out to add a column called view which contains a View-Button or View-Link for each row. Where clicking on this, need to navigate to another page with the clicked row id. 

Please help me to implement this. 

Bharat Jain  

Mahalakshmi Karthikeyan [Syncfusion]
Replied On March 10, 2016 06:55 AM UTC

Hi Bharat,

Thanks for contacting Syncfusion support.

We can get the view-Button in all the Rows of the TreeGrid control with the help of Column Template. Please refer the below code example for details.


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

       <button class="imageButton">Get Row Id</button>


<ej:TreeGrid ID="Treegrid" runat="server"  //… >


        <ej:TreeGridColumn HeaderText="View" Field="View" IsTemplateColumn="true"        






    function Redirect() {

        window.location = "Home.aspx";


    $("#Treegrid").on("click", ".imageButton", function (e) {

        var $tr = $(e.target).closest('tr'),

            treeObj = $("#Treegrid").data("ejTreeGrid"),

            rowIndex = ($tr).index(),

            record = treeObj.model.currentViewData && treeObj.model.currentViewData[rowIndex],

            id = record.Id;


            type: 'POST',

            url: 'TreeGridDefault.aspx/RowID',

            data: JSON.stringify({ "id": id }),

            contentType: 'application/json; charset=utf-8',

            dataType: 'json',

            success: function (data) {

                window.location = "Home.aspx";






        public static void RowID(int id)


            TreeGridDefault sam = new TreeGridDefault();



        public void serverMethod(int id)


            Session["id"] = id;          


Here we have maintained clicked row id in the session variable called “id” then we have redirected another page and there we have got the clicked id from the session and alerted the retrieved value in the message box.

We have also prepared a sample based on this and you can find the sample under the following location.

Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/PageNavigate-2059951840

Note: We have removed bin and obj folder in the given sample for some security reasons, we must include Syncfusion.EJ and Syncfusion.EJ.Web dlls to render the TreeGrid control which is available in Essential studio installed location    


Mahalakshmi K.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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