Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1730
Error in chtml page
posted

Hi,

I am using igDataChart as below:

 

 

 

 

 

 

@(  Html.Infragistics().DataChart(Model)
    .ID("chart")
    .Width("700px")
    .Height("400px")
    .VerticalZoomable(true)
    .HorizontalZoomable(true)
    .Axes((axes) =>    getting error on this line
    {
        axes.NumericX("xAxis");
        axes.NumericY("yAxis");
    })
    .DataBind()
    .Render()
)

Error is as below:

CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type

Parents
  • 2671
    Suggested Answer
    Offline posted

    Hi,

    Just as a note the code above is completely valid, event without the series and I just tested it and it produces the correct output. I did test with removing the model reference from my page and I got exactly the same error.

    Since I can't see the rest of your code I would assume that can be your issue and to resolve it you will need to reference your model in the View:

    1. @inherits System.Web.Mvc.WebViewPage<IQueryable<Sample.Customer>>
    2. <!-- or the shorter model syntax version: -->
    3. @model IQueryable<Sample.Customer>

    Both of those references do the same, use the one fo your preference and let me know if that solves your problem.

    If for some reason that is not the issue it would probably be best if you can provide a small sample application that reproduces the issue for us to look at.

    Regards,

    Damyan

Reply Children