Hi all
I am passing a class with 1 collection to the Grid and it works fine but with Chart it wont:
namespace ClientUpgrade.ViewModels
{
public class MasterDetailCombined
{
public IEnumerable<FullWindowsStats> FullWindowsStatuses { get; set; }
public IEnumerable<PartialWindowsStats> PartialWindowsStatuses { get; set; }
}
}
(VIEW)
@model ClientUpgrade.ViewModels.MasterDetailCombined
@(Html.Telerik().Grid(Model.FullWindowsStatuses)
.Name("TopGrid")
.Columns(columns =>
{...
However the Chart component behaves differently:
(VIEW)
@model ClientUpgrade.ViewModels.MasterDetailCombined
@(Html.Telerik().Chart<ClientUpgrade.ViewModels.MasterDetailCombined>()
.Name("chartAjax")
//.Theme(Html.GetCurrentTheme())
.Title("Client Upgrade Graph")
.Legend(legend => legend
.Position(ChartLegendPosition.Bottom)
)
.Series(series =>
{
series.Bar(s => s.Target).Name("Target Numbers") <== ERROR HERE
...
"Cannot convert lambda expression to type 'System.Collections.IEnumerable' because it is not a delegate type."
I don't understand why I get this error. Also, Chart won't accept just "Model", you have to type the whole namespace
such as ClientUpgrade.ViewModels.MasterDetailCombined
Also, is it necessary to type @model IEnumerable<> all the time? sometimeI jsut type the namespace and it works just fine.
Any help is welcome -- Thank you!