Type arguments for method cannot be inferred from the usage

2 posts, 0 answers
  1. Bill
    Bill avatar
    1 posts
    Member since:
    Nov 2007

    Posted 23 Feb 2017 Link to this post

    I am trying to create a line chart binding to grouped data, but when I use the code below I get a "CS0411: The type arguments for method 'Kendo.Mvc.UI.Fluent.DataSourceGroupDescriptorFactory<object>.Add<TValue>(System.Linq.Expressions.Expression<System.Func<object,TValue>>)' cannot be inferred from the usage. Try specifying the type arguments explicitly." error when I run it and in Visual Studio it underlines the ".Add" for group.Add and all the property names of the model (see attached screenshot).

    Any ideas why?


    @model IEnumerable<IntegrationLoader.Models.Application>
            .Title("Fatal Exceptions In Last 10 Days")
            .Legend(legend => legend
            .ChartArea(chartArea => chartArea
            .SeriesDefaults(seriesDefaults =>
            .DataSource(dataSource => dataSource
                .Read(read => read.Action("AppCounts_Read", "LogEntries"))
                .Group(group => group.Add(model => model.Name))
                .Sort(sort => sort.Add(model => model.Day).Ascending())
            .Series(series =>
                series.Line(model => model.FatalCount)
                    .Name("#= group.value # (Count)");
            .CategoryAxis(axis => axis
                .Categories(model => model.Day)
                .Labels(labels => labels.Format("yyyyMMdd"))
            .ValueAxis(axis => axis
                .Numeric().Labels(labels => labels.Format("{0}"))
                .Line(line => line.Visible(false))
            .Tooltip(tooltip => tooltip



  2. Alex Hajigeorgieva
    Alex Hajigeorgieva avatar
    987 posts

    Posted 27 Feb 2017 Link to this post

    Hello Bill,

    The error which is enclosed in this ticket most likely occurs because the Kendo UI Chart has no knowledge of the model. 

    If you change the first line as below, it should work as expected:


    Documentation reference: 


    Let me know how you get on.

    Kind Regards,
    Alex Hajigeorgieva
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top