RowTemplates?

4 posts, 0 answers
  1. Sandy
    Sandy avatar
    5 posts
    Member since:
    Oct 2010

    Posted 11 Jun 2012 Link to this post

    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.
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 13 Jun 2012 Link to this post

    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!
  3. Hugues
    Hugues avatar
    5 posts
    Member since:
    Nov 2011

    Posted 03 Apr 2013 Link to this post

    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()

  4. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 08 Apr 2013 Link to this post

    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!
Back to Top