Searching with paging in telerik mvc grid

6 posts, 0 answers
  1. Lasse
    Lasse avatar
    58 posts
    Member since:
    Oct 2010

    Posted 08 Apr 2014 Link to this post

    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
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 10 Apr 2014 Link to this post

    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.

     
  3. Ross
    Ross avatar
    6 posts
    Member since:
    Sep 2016

    Posted 30 May 2017 Link to this post

    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

  4. Stefan
    Admin
    Stefan avatar
    2922 posts

    Posted 01 Jun 2017 Link to this post

    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.
  5. Ross
    Ross avatar
    6 posts
    Member since:
    Sep 2016

    Posted 01 Jun 2017 in reply to Stefan Link to this post

    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

  6. Stefan
    Admin
    Stefan avatar
    2922 posts

    Posted 05 Jun 2017 Link to this post

    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 visualization (charts) and form elements.
Back to Top