Trying to attach an event to the Core Sparkline wrapper like this:
@(Html.Kendo().Sparkline()leads to a compilation error:
Error CS0121 The call is ambiguous between the following methods or properties: 'SparklineBuilder<T>.Events(Action<ChartEventBuilder>)' and 'SparklineBuilder<T>.Events(Action<SparklineEventBuilder>)'
Hi,
The issue is caused since there are two almost identical overloads of the Events method. One accepts an action of SparklineEventBuilder and another accepts an action of ChartEventBuilder. As these builders are not interchangeable, we cannot remove either of them at this point.
To avoid the compilation error, cast the action as shown below:
.Events((Action<Kendo.Mvc.UI.Fluent.ChartEventBuilder>)(e=>e.SeriesClick("onSeriesClick")))
or
.Events((Action<Kendo.Mvc.UI.Fluent.SparklineEventBuilder>)(e=>e.SeriesClick("onSeriesClick")))
I hope this helps.
Regards,
Georgi
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.