I am trying to use a GroupBy'd lambda expression with a Panel Bar... the desired effect being that the "Groups" and the Panel Bar names. For example:
List<Product
I have the Panel Bar headers reading properly with:
@(Html.Telerik().PanelBar()
.Name(
"PanelBar")
.BindTo(Model, mappings =>
{
mappings.For<
IGrouping<string, Product >>(binding => binding
.ItemDataBound((parent, grouping) =>
{
parent.Text = grouping.Key;
})
}
)
)
But I cannot get the children to populate correctly
<THE BELOW DOES NOT WORK - COMPILER ERROR>
@(Html.Telerik().PanelBar()
.Name("PanelBar")
.BindTo(Model, mappings =>
{
mappings.For<
IGrouping<string, Product>>(binding => binding
.ItemDataBound((parent, grouping) =>
{
parent.Text = grouping.Key;
})
.Children(grouping => grouping.Select(g => g)));
mappings.For<
Product>(binding => binding
.ItemDataBound((child, product)
{
child.Text = product.Name;
}));
}
)
)
Any help would be very much appreciated.
Thanks in advance!
- Clay Ver Valen