Hi guys,
I simply modified the last version of samples (grid/index.chtml), in order to test a grouping configuration as described in documentation.
But the Groups property does not exist.
Here the code below:
@model Kendo.Mvc.Examples.Models.HeaderTemplateViewModel
@{using (Html.BeginForm())
{
@(Html.Kendo().Grid(Model.Products)
.Name("Grid")
.Columns(columns =>
{
columns.Template(@<text>
<input name="selectedProducts" type="checkbox" title="select product" value="@item.ProductID"
@{
if (Model.SelectedProducts.Any(p => p.ProductID == item.ProductID))
{
@("checked=checked")
}
}/>
</text>)
.HeaderTemplate(@<text>
<input id="selectAllProducts" type="checkbox" title="select all"
@{
if (Model.SelectedProducts.Any())
{
@("checked=checked")
}
} />
</text>)
.Width(50)
.HtmlAttributes(new { style = "text-align:center" })
.HeaderHtmlAttributes(new { style = "text-align:center" });
columns.Bound(p => p.ProductName);
columns.Bound(p => p.UnitPrice);
columns.Bound(p => p.UnitsInStock);
})
.Pageable()
.Groupable(grouping => grouping
.Groups(groups =>
{
groups.Add(p => p.ProductName);
})
)
)
<p>
<button class="k-button">
Display selected products</button>
</p>
}
}
Version: 2014.1.528.545 Dev
Thanks for helping
I simply modified the last version of samples (grid/index.chtml), in order to test a grouping configuration as described in documentation.
But the Groups property does not exist.
Here the code below:
@model Kendo.Mvc.Examples.Models.HeaderTemplateViewModel
@{using (Html.BeginForm())
{
@(Html.Kendo().Grid(Model.Products)
.Name("Grid")
.Columns(columns =>
{
columns.Template(@<text>
<input name="selectedProducts" type="checkbox" title="select product" value="@item.ProductID"
@{
if (Model.SelectedProducts.Any(p => p.ProductID == item.ProductID))
{
@("checked=checked")
}
}/>
</text>)
.HeaderTemplate(@<text>
<input id="selectAllProducts" type="checkbox" title="select all"
@{
if (Model.SelectedProducts.Any())
{
@("checked=checked")
}
} />
</text>)
.Width(50)
.HtmlAttributes(new { style = "text-align:center" })
.HeaderHtmlAttributes(new { style = "text-align:center" });
columns.Bound(p => p.ProductName);
columns.Bound(p => p.UnitPrice);
columns.Bound(p => p.UnitsInStock);
})
.Pageable()
.Groupable(grouping => grouping
.Groups(groups =>
{
groups.Add(p => p.ProductName);
})
)
)
<p>
<button class="k-button">
Display selected products</button>
</p>
}
}
Version: 2014.1.528.545 Dev
Thanks for helping