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

Grid Groupable not working

7 Answers 621 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rocio
Top achievements
Rank 1
Rocio asked on 02 Aug 2016, 05:56 PM

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

7 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 04 Aug 2016, 03:46 PM
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.
0
Rocio
Top achievements
Rank 1
answered on 05 Aug 2016, 07:17 PM

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.

 

0
vinay
Top achievements
Rank 1
answered on 07 Jun 2017, 03:05 PM

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.

0
Alex Hajigeorgieva
Telerik team
answered on 09 Jun 2017, 12:35 PM
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 (charts) and form elements.
0
Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 10 Jun 2017, 02:09 PM
checkin on somerhing
0
vinay
Top achievements
Rank 1
answered on 13 Jun 2017, 07:34 AM

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

0
Alex Hajigeorgieva
Telerik team
answered on 14 Jun 2017, 02:55 PM
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.
Tags
Grid
Asked by
Rocio
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Rocio
Top achievements
Rank 1
vinay
Top achievements
Rank 1
Alex Hajigeorgieva
Telerik team
Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or