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

Current Page and Current Selected Row

Thread ID:





123680 Apr 10,2016 07:46 PM UTC Apr 11,2016 10:53 AM UTC ASP.NET MVC 1
Tags: Grid
Brent Nelson
Asked On April 10, 2016 07:46 PM UTC

Is there an easy way to pass the current page and current row via a hyperlink to another page?  For example, I have a grid with an edit link in the last column.  I'd love to be able to send the user back to the exact page as they left when they went off to edit the record.  See code example below.


                .PageSettings(p => { p.PageSize(20); p.EnableQueryString(true); })
                .FilterSettings(filter => { filter.FilterType(FilterType.Excel); })
                .Columns(col =>
                    col.Field(p => p.PubId).HeaderText("Id").IsPrimaryKey(true).Width(10).Add();
                    col.Field(p => p.Category).HeaderText("Category").Width(15).Add();
                    col.Field(p => p.FirstAuthor).HeaderText("First").Width(15).Add();
                    col.Field(p => p.Year).HeaderText("Year").Width(10).Add();
                    col.Field(p => p.Title).HeaderText("Title").Width(80).Add();
                    col.HeaderText("Actions").Width(10).Template("<a rel='nofollow' href='Pubs/DetailsEdit/{{:PubId}}?page={{:page}}'>Edit</a>").Add();

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On April 11, 2016 10:53 AM UTC

Hi Brent,

To pass a current page of Grid and the selected row via QueryString to another page, you can use the TemplateRefresh event. In the TemplateRefresh event, you can append the a query string to the rel='nofollow' href attribute as shown in the below code example and refer to the TemplateRefresh event Help Document.



            . . . ..

        .Columns(col =>


            col.Field("EmployeeID").HeaderText("Employee ID").Width(75).Add();

               . .  . . ..  .

            col.HeaderText("Actions").Width(20).Template("<a rel='nofollow' href='/Home/Contact'>Edit</a>").Add();





    function templateRefresh(args) {

        var rel='nofollow' href = $(args.cell).find("a").attr("rel='nofollow' href");

        $(args.cell).find("a").attr("rel='nofollow' href", rel='nofollow' href + "?Page=" + this.model.pageSettings.currentPage + "&SelectedRow=" + args.rowIndex);

        //this.getRowByIndex(args.rowIndex); to get a row based on index

        //this.model.currentViewData[args.rowIndex]; to get the current data based on the index



We have also prepared a sample that can be downloaded from the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/123680/ze/Grid_TempCol-1383763116.zip

You have quoted that would like to get back to Grid page with its state retained after performing editing action. To persist state of Grid page and other model properties, you can use enablePersistence property of Grid. While switching to Grid page after editing, the Grid will show the page where customer left. Refer to the following Help Document.


Seeni Sakthi Kumar S.


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