Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
5.00/5 (3 votes)
See more:
In kendo documentation page I saw the below code in RowTemplate section..
Link

C#
@model IEnumerable<Product>
@(Html.Kendo().Grid(Model)
    .Name("grid")
    .RowTemplate(@<text>
        <div>Product Name: @product.ProductName</div>
        <div>Units In Stock: @product.UnitsInStock</div>
    </text>)
)


Anyone please tell me what is that @product ..And where it is defined.
Posted
Comments
Shemeemsha (ഷെമീംഷ) 12-Oct-14 8:19am    
But @product showing error
[no name] 12-Oct-14 8:20am    
try out with @item.
as in my solution, this would work.

1 solution

Since we pass the Model through the Grid, the Kendo Grid using row template is smart enough to get the values as
model => model.ProductName using @product.ProductName, we could use any name @item.ProductName too...
 
Share this answer
 
Comments
Shemeemsha (ഷെമീംഷ) 12-Oct-14 8:20am    
Thank you Suraj.. It is working...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900