Grid inside grid

9 posts, 0 answers
  1. Marko
    Marko avatar
    12 posts
    Member since:
    Apr 2009

    Posted 02 Feb 2012 Link to this post

    Hi,

    Is it possible to implement following scenario using KendoUI Grid or upcoming ListView widget?

    Main grid (Show all rows from Groups tabe)

    ID   Name           Members
    1    Group 1        SubGrid (Show rows from Members table where Members.GroupID=Current row's GroupID)
    2    Group 2        SubGrid (show members in group 2)
    3    Group 3        SubGrid (show members in group 3)
    ...

    BR
    Marko

  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    1850 posts
    Member since:
    Sep 2012

    Posted 02 Feb 2012 Link to this post

    Hello Marko,

    The following example demonstrates how to create grid hierarchy:
    http://demos.kendoui.com/web/grid/hierarchy.html

    Greetings,
    Nikolay Rusev
    the Telerik team

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!

  3. Marko
    Marko avatar
    12 posts
    Member since:
    Apr 2009

    Posted 02 Feb 2012 Link to this post

    Hi,

    Thanks for the reply.

    The example you referred could be work-around in this scenario if all rows could be expanded by default (instead of first one).

    I tried to replace "first" with "all" in grid.expandRow method, but it was not supported.
    grid.expandRow(grid.tbody.find(">tr.k-master-row:first"));

    Is it possible to expand all rows code behind?

    BR
    Marko

  4. Greffin
    Greffin avatar
    9 posts
    Member since:
    Jan 2012

    Posted 02 Feb 2012 Link to this post

    Hi Nikolay,

    I tried the code to this http://demos.kendoui.com/web/grid/hierarchy.html  
    example in Grid Hierarchy, but i keep getting errors when i click to view the details.

    Errors says: 

    $("<div></div>").appendTo(e.detailCell).kendoGrid is not a function

    Can you help me with it, i want to do a main grid and sub grid too. 

    Thanks. 

  5. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    1850 posts
    Member since:
    Sep 2012

    Posted 02 Feb 2012 Link to this post

    Hello Greffin,

    :all is not valid jQuery selector. You can iterate over grid items and call expandRow.

    Greetings,
    Nikolay Rusev
    the Telerik team

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!

  6. Marko
    Marko avatar
    12 posts
    Member since:
    Apr 2009

    Posted 02 Feb 2012 Link to this post

    Hi Nikolay,

    The number of rows will be so small in my case, so iterating all grid rows might work.

    I did not find any examples or documentation how to iterate grid rows.

    BR
    Marko

  7. Greffin
    Greffin avatar
    9 posts
    Member since:
    Jan 2012

    Posted 02 Feb 2012 Link to this post

    Hi Nikolay 

    As what Marko say's, can you provide us how to iterate grid rows . It would be a great of help.

    Thanks.

  8. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    1850 posts
    Member since:
    Sep 2012

    Posted 03 Feb 2012 Link to this post

    Hello,

    Using the following selector you can find all grid items:

    var grid = $("#grid").data("kendoGrid"),
       rows = grid.table.find(">tbody>tr");


    Greetings,
    Nikolay Rusev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!

  9. Ilyas
    Ilyas avatar
    6 posts
    Member since:
    Dec 2011

    Posted 07 Feb 2012 Link to this post

    Hi,

    Is it possible to Select AND Highlight a Grid row on page load?


Back to Top