RowTemplate and columns?

2 posts, 0 answers
  1. Ken De Vries
    Ken De Vries avatar
    24 posts
    Member since:
    Mar 2010

    Posted 21 Oct 2015 Link to this post


     I am trying to create a grid with one column to return a result similar to your example here:  I am using the server-side RowTemplate code such as...

                    .RowTemplate(grid =>
                                ID: @item.ComponentID<br>

                                Name: @item.Name

                                ... etc

                .DataSource(d => d.Ajax().ServerOperation(false))
                .Pageable(pageable => pageable

     I am basing my code on this example:

    @model IEnumerable<Product>@(Html.Kendo().Grid(Model).Name("grid")

        .RowTemplate(grid => @<text><div>Product Name: @product.ProductName</div><div>Units In Stock: @product.UnitsInStock</div></text>))

    ​The output completely ignores the rowFormat and prints every field in the model object as a separate column (see attached photo).

    I have tried almost everything - client templates, etc.  Nothing stops every column from being displayed.

     Any ideas would be appreciated.

  2. Dimiter Madjarov
    Dimiter Madjarov avatar
    2288 posts

    Posted 22 Oct 2015 Link to this post

    Hello Ken,

    The current Grid uses an Ajax DataSource, meaning that a client row template should be used instead. You could find the MVC equivalent of the demo here.

    Dimiter Madjarov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top