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

Grid inside grid

8 Answers 2739 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marko
Top achievements
Rank 1
Marko asked on 02 Feb 2012, 09:03 AM
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

8 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 02 Feb 2012, 09:16 AM
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!
0
Marko
Top achievements
Rank 1
answered on 02 Feb 2012, 09:52 AM
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
0
Greffin
Top achievements
Rank 1
answered on 02 Feb 2012, 10:00 AM
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. 

0
Nikolay Rusev
Telerik team
answered on 02 Feb 2012, 10:05 AM
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!
0
Marko
Top achievements
Rank 1
answered on 02 Feb 2012, 10:56 AM
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

0
Greffin
Top achievements
Rank 1
answered on 03 Feb 2012, 01:06 AM
Hi Nikolay 

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

Thanks.

0
Nikolay Rusev
Telerik team
answered on 03 Feb 2012, 10:55 AM
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!
0
Ilyas
Top achievements
Rank 1
answered on 07 Feb 2012, 05:22 PM
Hi,

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


Tags
Grid
Asked by
Marko
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Marko
Top achievements
Rank 1
Greffin
Top achievements
Rank 1
Ilyas
Top achievements
Rank 1
Share this question
or