Reputation: 435
I am currently working with Telerik Kendo UI for ASP.NET Core, version 2022.3.913. While trying to add a custom button to the scheduler component, I encountered an error in Visual Studio. The error message states:
"SchedulerToolbarFactory does not contain a definition for 'Custom' and no accessible extension method 'Custom' accepting a first argument of type 'SchedulerToolbarFactory' could be found."
This error suggests that the Custom method might not be available in the version of Telerik that I am using. I would like to understand which version of Telerik introduced the Custom extension for the scheduler component or if there might be a different mistake causing this issue. Could this be a version compatibility problem, or am I missing something in the setup? Code:
<div class="text-center">
@(Html.Kendo().Scheduler<Bron.Models.Views.SchedulerModel>()
.Name("scheduler")
.Date(DateTime.Now.Date)
.StartTime(DateTime.Now.Date)
.MajorTick(60)
.Toolbar(toolbar =>
{
toolbar.Custom().Text("My Custom Button").HtmlAttributes(new { @class = "my-custom-button" });
// You can add more custom toolbar items here
})
...
.Timezone("Etc/UTC")
.Group(group => group.Resources("Locations", "Places").Orientation(SchedulerGroupOrientation.Vertical))
.Resources(resource =>
{
resource.Add(m => m.LocationId)
.Title("Локация")
.Name("Locations")
.DataTextField("name")
.DataValueField("Id")
.DataSource(ds => ds.Read("GetList", "Locations"));
resource.Add(m => m.Places)
.Title("Номера")
.Name("Places")
.Multiple(true)
.DataTextField("name")
.DataValueField("Id")
.DataParentValueField("location_id")
.DataSource(ds => ds.Read("GetList", "Places"));
})
.DataSource(d => d
.Model(m =>
{
m.Id(f => f.Id);
m.Field(f => f.Title).DefaultValue("No title");
m.RecurrenceId(f => f.RecurrenceID);
})
.Read("GetAll", "Home")
.Create("Create", "Home")
.Destroy("Timeline_Destroy", "Home")
.Update("Timeline_Update", "Home")
)
.Editable(editable =>
{
editable.TemplateName("SchedulerEditorTemplate");
})
....
))
)
</div>
Upvotes: 1
Views: 27