Friday, 13 September 2013

using @model IQuerable, and strong type in View

using @model IQuerable, and strong type in View

How can I using IQueryable for the grid and keep strong type in view?
Here is the view coding:
Index.cshtml
@model IQueryable<MVCApplication.Models.Product>
@(Html.Grid<model>.()
.AutoGenerateLayouts(false)
.Columns ( column =>
{
column.For( e => e.ProductID)
}
)
@Html.DisplayNameFor(model => model.ProductID)
If I used "@model IQueryable", I losed the strong type view.
Thanks Wilson

No comments:

Post a Comment