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

RowTemplates?

3 Answers 213 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sandy
Top achievements
Rank 1
Sandy asked on 12 Jun 2012, 01:14 AM
Hi,

I am just wondering how i can use Kendo.UI MVC Grid to create a custom row template. I can see that it is possible in the Telerik.MVC Grid (http://demos.telerik.com/aspnet-mvc/razor/grid/clientrowtemplate), but can only see column template support in Kendo.

Am i missing something, or is feature possible?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 13 Jun 2012, 12:15 PM
Hi Sandy,

Yes currently the Grid wrapper does not support RowTemplates, however we are working to provide such functionality. 

Greetings,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Hugues
Top achievements
Rank 1
answered on 03 Apr 2013, 12:32 PM
A year has gone by, is this now supported? It seems that it is supported since it's part of the API. I'm currently trying to implement it but running into a problem where I can't make the template span across all columns. Is there a way to do this with MVC Wrappers? 

I would expect the following code to create rows that span columns, but instead each data cell contains the rendered template. Thanks!

    Dim gridBuilder As GridBuilder(Of time_card) = _
        Html.Kendo().Grid(Of time_card)().Name("TimecardGrid")
    gridBuilder.DataSource(Function(c As DataSourceBuilder(Of time_card)) c.Ajax().Read(Function(r) r.Action("Cards_Read", "Home")))
    gridBuilder.Columns(Function(columns As GridColumnFactory(Of time_card)) columns.Bound(Function(o) o.tc_date))
    gridBuilder.Columns(Function(columns As GridColumnFactory(Of time_card)) columns.Bound(Function(o) o.tc_index))
    gridBuilder.Columns(Function(columns As GridColumnFactory(Of time_card)) columns.Bound(Function(o) o.billed_hours))
    gridBuilder.ClientRowTemplate("<tr><td rowspan='3'>#= tc_date #<br/>#= billed_hours #</td></tr>")
    gridBuilder.Sortable()
    gridBuilder.Pageable()
    gridBuilder.Render()

0
Petur Subev
Telerik team
answered on 08 Apr 2013, 06:27 AM
Hello Sandy,

To make the cell span across multiple columns you need to specify the colspan property to be equal to three, not the rowspan property.

http://www.htmlcodetutorial.com/tables/index_famsupp_30.html


Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Sandy
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Hugues
Top achievements
Rank 1
Share this question
or