Problem with ClientGroupHeaderTemplate???

4 posts, 0 answers
  1. Lennart
    Lennart avatar
    4 posts
    Member since:
    Apr 2013

    Posted 02 Jul 2013 Link to this post

    Hej

    Im trying to use the Kendo Grid for a minor project, where i want to show the column summary in the groupheader. But I cant get it to Work :-(. When i use the Groupfooter, then it works fine.

    Anyone got any suggestions?

    ************************************************************************************
    @(Html.Kendo().Grid((IEnumerable<FTEReport>)ViewBag.Test) 
         .Name("grid")
         .Columns(columns =>
    {
     columns.Bound(FTEReport => FTEReport.Jan)
    .ClientGroupHeaderTemplate("#=sum#");

    columns.Bound(FTEReport => FTEReport.Feb)
    .ClientGroupFooterTemplate("#=sum#"); 
    }
     .DataSource(ds => ds.Ajax()
    .Aggregates(aggregates =>
    {
    aggregates.Add(p => p.Jan).Sum();
    aggregates.Add(p => p.Feb).Sum();
     })
    .Group(g =>
    {
    g.Add(c => c.Allocated);
    g.Add(c => c.Project);
    g.Add(c => c.Department);
    })
    .Read(read => read.Action("Aggregates_Read", "grid"))
     )
    )

    Regards
    Lennart
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2194 posts

    Posted 04 Jul 2013 Link to this post

    Hi Lennart,

    I tried to reproduce the problem locally but to no avail – everything is working as expected on our side. Could you please provide runable project where the issue is reproduced? This would help us pinpoint the exact reason for this behavior.

    Kind Regards,
    Vladimir Iliev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Lennart
    Lennart avatar
    4 posts
    Member since:
    Apr 2013

    Posted 04 Jul 2013 Link to this post

    Hi Vladimir

    Thx for your reply!

    I have made a standard Kendo Project. (Full Project was to big to attach, so attach the files in the "Controllers","Models" and "Views" Folder).

    Other thing Dont look like changes the Group order Works, when .Groupable() is able.


    Regard
    Lennart
  4. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2194 posts

    Posted 08 Jul 2013 Link to this post

    Hi Lennart,

     
    From the provided information it seems that the ClientGroupFooterTemplates are not working as the Grid initially is bind to data from the ViewBag in which case the GroupFooterTemplate is used instead. In current scenario I would suggest to always load the Grid data using Ajax requests:

    e.g.:

    • Grid code:
      Html.Kendo().Grid<ForeignKeyColumnDemo.Models.FTEReport>()
          .Name("grid")
          .Columns(columns =>
          {
    • Controller: 
      public ActionResult Aggregates_Read([DataSourceRequest] DataSourceRequest request)
      {
          List<FTEReport> test = new List<FTEReport>()
          {
              new FTEReport {Allocated="Preclinical", Project = "SYM01", Department="AD", Role="Scientists",Jan=1,Feb=1,Mar=1,Apr=1,May=1,Jun=1,Jul=1,Aug=1,Sep=1,Oct=1,Nov=1,Dec=1},
              new FTEReport {Allocated="Preclinical",Project = "SYM01", Department="AD", Role="Technicians",Jan=1,Feb=1,Mar=1,Apr=1,May=1,Jun=1,Jul=1,Aug=1,Sep=1,Oct=1,Nov=1,Dec=1},
              new FTEReport {Allocated="Preclinical",Project = "SYM01", Department="CMC", Role="Scientists",Jan=1,Feb=1,Mar=1,Apr=1,May=1,Jun=1,Jul=1,Aug=1,Sep=1,Oct=1,Nov=1,Dec=1},
              new FTEReport {Allocated="Preclinical",Project = "SYM01", Department="CMC", Role="Technicians",Jan=1,Feb=1,Mar=1,Apr=1,May=1,Jun=1,Jul=1,Aug=1,Sep=1,Oct=1,Nov=1,Dec=1},
              new FTEReport {Allocated="Preclinical",Project = "SYM04", Department="CMC", Role="Scientists",Jan=1,Feb=1,Mar=1,Apr=1,May=1,Jun=1,Jul=1,Aug=1,Sep=1,Oct=1,Nov=1,Dec=1},
              new FTEReport {Allocated="Preclinical",Project = "SYM04", Department="CMC", Role="Technicians",Jan=1,Feb=1,Mar=1,Apr=1,May=1,Jun=1,Jul=1,Aug=1,Sep=1,Oct=1,Nov=1,Dec=1}
          };
       
          return Json(test.ToDataSourceResult(request));
      }
    •    
    Kind Regards,
    Vladimir Iliev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top