This is a migrated thread and some comments may be shown as answers.

Searching with paging in telerik mvc grid

5 Answers 193 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lasse
Top achievements
Rank 1
Lasse asked on 08 Apr 2014, 07:07 PM
hi all,
Actually this is related to telerik mvc extension grid.In my telerik grid i have an search text box.i write something in text box and press enter,fire a java script function,from the function i call...ajaxrequest function of grid to rebind the grid for the search.That the simple process.
ok.suppose i am in last page in grid.then i write something in the search textbox and press enter,the search is ok.but the paging is not in correct position.i need to go to the first page in this situation...keypresss enter event is bellow

function ListSearch(keyCode, gridObj)
{
    window.CurrentList = gridObj;
    var id = '#' + $(gridObj).attr('id');
    var searchTxt = $(id + " .watermark-list-search").val();
    var searchList = $(id + " .watermark-list-search").attr('listtype');
    var filterid = $(id + " .watermark-list-search").attr('filterid');

    window.CurrentList.data("tGrid").ajaxRequest({ Name: searchTxt, Data: searchList, id: filterid });
}

i modified the code to include page in ajaxrequest like

window.CurrentList.data("tGrid").ajaxRequest({ Name: searchTxt, Data: searchList, id: filterid,page:1 });


it works i.e getting correct data from database but the current page is wrong and showing wrong status '31 to 60 out of 120 ' instead of '1 to 30 out of 20'

what is the process to make it correct?please let me know

5 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 10 Apr 2014, 01:58 PM
Hello Mikkel,

Telerik MVC Extensions that you are using are no longer supported. Consider migrating to UI for MVC (KendoUI MVC Wrappers):

http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/migration/migrating-from-telerik-extensions-for-aspnet-mvc

Kind Regards,
Petur Subev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Ross
Top achievements
Rank 1
answered on 30 May 2017, 02:04 PM

Hello!

I am using a 2017 version of the Kendo Grid, with MVC application.

I have the same issue. I have a search box and a Kendo MVC Grid with paging enabled:

1. Load the grid with several pages

2. Click on the Last page button on the grid

3. Search and item using the custom search box

4. The results are correct but the Page number is not shown its just |< < ... > >| (last 2 buttons are disabled)

 

Is this a bug or am I just doing it wrong?

 

var totalCount = 0;
var products = GetAllProducts("", searchString, request.Page, request.PageSize, out totalCount);
 
return Json(new DataSourceResult
{
    Data = products,
    Total = totalCount,
}, JsonRequestBehavior.AllowGet);

 

Thanks!

Ross

0
Stefan
Telerik team
answered on 01 Jun 2017, 10:17 AM
Hello Ross,

I was not able to reproduce the same issue on my end.

I noticed that the total number of items is sent the to Grid, but I can assume that they are not correctly received or parsed as the similar issue may occur if the Grid, does not receive the correct parameters from the server.

As the issue may be caused by a custom factor which we are overlooking at this moment, please send a fully runnable example and I will gladly assist.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Ross
Top achievements
Rank 1
answered on 01 Jun 2017, 11:24 AM

Thank you Stefan!

I will see what I can do first, then maybe if I have ample time I will create a working sample to send to you.

 

Regards

0
Stefan
Telerik team
answered on 05 Jun 2017, 05:47 AM
Hello Ross,

I hope that the issue can be fixed easily.

Still, if additional assistance is needed, I will be happy to assist further.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
Tags
Grid
Asked by
Lasse
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Ross
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or