Error: Cannot convert lambda expression to type 'bool' because it is not a delegate type in Kendo Chart
Error: Cannot convert lambda expression to type 'bool' because it is not a delegate type in Kendo Chart
我正在为 Kendo 图表标签做一些流畅的标记:
.Labels(x =>
x.DateFormats(formats =>
formats
.Days(MyFormat.DateReportByDay)
.Months(MyFormat.DateReportByMonth))
.Culture(Thread.CurrentThread.CurrentCulture)
我得到这个错误:
Compiler Error Message: CS1660: Cannot convert lambda expression to type 'bool' because it is not a delegate type
但是如果我使用这个代码:
.Labels(x =>
x.DateFormats(formats =>
formats
.Days("dd")
.Months("MMM yy"))
.Culture(Thread.CurrentThread.CurrentCulture)
它工作正常。我对格式变量的定义是
public static class MyFormat
{
public const string DateReportByMonth = "MMM yy";
public static string DateReportByDay = "dd";
}
它说我不能用字符串常量代替字符串??这太疯狂了!
好吧,看来@Didaxis 是对的,我进行了重建,它似乎已修复。奇怪。
我正在为 Kendo 图表标签做一些流畅的标记:
.Labels(x =>
x.DateFormats(formats =>
formats
.Days(MyFormat.DateReportByDay)
.Months(MyFormat.DateReportByMonth))
.Culture(Thread.CurrentThread.CurrentCulture)
我得到这个错误:
Compiler Error Message: CS1660: Cannot convert lambda expression to type 'bool' because it is not a delegate type
但是如果我使用这个代码:
.Labels(x =>
x.DateFormats(formats =>
formats
.Days("dd")
.Months("MMM yy"))
.Culture(Thread.CurrentThread.CurrentCulture)
它工作正常。我对格式变量的定义是
public static class MyFormat
{
public const string DateReportByMonth = "MMM yy";
public static string DateReportByDay = "dd";
}
它说我不能用字符串常量代替字符串??这太疯狂了!
好吧,看来@Didaxis 是对的,我进行了重建,它似乎已修复。奇怪。