Grid Groupable not working

8 posts, 0 answers
  1. Rocio
    Rocio avatar
    28 posts
    Member since:
    Dec 2015

    Posted 02 Aug 2016 Link to this post

    Thank you in advance for any feedback!

    I am attaching some sample code where I am binding data with grid; then setting the groupable option to true.  When I intend to use the group column two things happens.  One it displays the field name and not the title name, and the most important part it returns nothing.

     

    Rocio

  2. Dimo
    Admin
    Dimo avatar
    8385 posts

    Posted 04 Aug 2016 Link to this post

    Hi Rocio,

    Based on the provided information, I suspect the Grid is initialized two times - once via kendo.bind() and once programmatically via kendoGrid(). The second initialization removes the dataSource settings, or at least I do not see them in the code. As a result, grouping cannot occur, as there is no information where to get the data from.

    Duplicate initialization is not allowed:

    http://docs.telerik.com/kendo-ui/intro/installation/jquery-initialization#duplicate-initialization

    If your scenario is different, please elaborate and even better, send a runnable example.

    Regards,
    Dimo
    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
  3. Rocio
    Rocio avatar
    28 posts
    Member since:
    Dec 2015

    Posted 05 Aug 2016 in reply to Dimo Link to this post

    Thank you for your reply. You are correct, I was initializing two times the grid and that was causing the problem.  In addition, I was defining a table and then binding the grid to the table which may have been part of the problem too.  I followed your directions, and only bind it to a div; and not it works.

     

  4. vinay
    vinay avatar
    2 posts
    Member since:
    Jun 2017

    Posted 07 Jun Link to this post

    Hi Dimo,

    I have similar problem in Telerik grid.

    If i didn't write DataBinding and EnableCustomBinding, groupable is working. If i write DataBinding and EnableCustomBinding(true) then the data it is showing blank. But it is fetching from the back end.

    What is the problem.

  5. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    249 posts

    Posted 09 Jun Link to this post

    Hello Vinay,

    I'm afraid that the provided information is not sufficient. Could you please elaborate on the scenario and provide as much as possible of the following:

    - the grid and data source configurations
    - a runnable demo to illustrate  your case
    - step by step instructions to reproduce it

    Look forward to your response.

    Kind Regards,
    Alex Hajigeorgieva
    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.
  6. Joshua
    Joshua avatar
    67 posts
    Member since:
    May 2012

    Posted 10 Jun in reply to Rocio Link to this post

    checkin on somerhing
  7. vinay
    vinay avatar
    2 posts
    Member since:
    Jun 2017

    Posted 13 Jun in reply to Alex Hajigeorgieva Link to this post

    Hi Alex,

    Thanks for the reply. I will try to explain my problem what ever i am facing. We were using telerik.

    Very first i am calling the below Action i.e Vendors. At that time the grid is populating with out any issue. For example you can find the first attachment.

    [HttpGet]        
    public ActionResult Vendors(int? id)
    {            
        ViewBag.TotalRows = 0;                       
        try
        {
            GridMetaData gridMetaData = new GridMetaData();
            gridMetaData.PageSize = 20;
            
            List<PurchaseVendorViewModel> list = CommonSrv.GetVendors(gridMetaData, LoggedInUserId, searchText, ContextMainTabId);
            ViewBag.TotalRows = list.Count > 0 ? list[0].TotalRows : 0;
            
            return View("~/Views/Common/Vendor/Vendors.cshtml", list);
        }
        }
        catch (Exception ex)
        {                
            throw ex;
        }
    }
     
    After that if we don't use EnableCustomBinding and DataBinding then Grouping is working fine without any issue. If we use EnableCustomBinding and DataBinding then it is showing as in the second attachment.

    Please find the telerik grid code in the 3rd image.

    DataBinding action is Vendors. Please find the code regarding DataBinding in the 4th attachment.

     

    Regards,

    Vinay Kumar

  8. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    249 posts

    Posted 14 Jun Link to this post

    Hello Vinay,

    Thank you for the provided screenshots.

    Firstly, can you confirm that you are using the latest Kendo UI version? The DataKeys configuration was moved to the DataSource model five years ago:

    http://docs.telerik.com/aspnet-mvc/migration/widgets/grid#datakeys

    And the same goes for the DataBinding configuration:

    http://docs.telerik.com/aspnet-mvc/migration/widgets/grid#data-binding

    What is the preferred way of binding the Kendo UI Grid? It looks like server binding - note how the model is passed to the grid HTML helper:

    @model IEnumerable<Kendo.Mvc.Examples.Models.Product>
                
    @(Html.Kendo().Grid(Model)
        .Name("Grid")

    http://demos.telerik.com/aspnet-mvc/grid/serveraggregates

    If you wish to enable custom server binding, then check the demo here:

    http://demos.telerik.com/aspnet-mvc/grid/customserverbinding

    @(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.Order>()

    Kind Regards,
    Alex Hajigeorgieva
    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