This is a migrated thread and some comments may be shown as answers.

How to display reccurrence pattern in EditorTemplate?

2 Answers 132 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Allan
Top achievements
Rank 1
Veteran
Allan asked on 30 Nov 2020, 06:56 AM

Hello,

I am having an issue, where I am not able to display the reccurence pattern in my cusom EditorTemplate. 

The pattern is being read fine from my database, and the tasks are being shown correctly in the Scheduler. The recurrence is just not being showed, when I click on a task - see picture 1 (danish). I want to display the recurrence, like shown in the Scheduler demo - see picture 2.

The reccurrence pattern is being read from my database, and is bound via a string property to the Html.Kendo().RecurrenceEditorFor.

 

Hope you can help me.

 

<!-- RECCURENCE -->
    <div class="k-edit-label">
        @(Html.LabelFor(model => model.RecurrenceRule, "Gentagelser"))
    </div>
    <div data-container-for="recurrencerule" class="k-edit-field">
        @(Html.Kendo().RecurrenceEditorFor(model => model.RecurrenceRule)
        .Name("recurrenceEditor")
        .HtmlAttributes(new { data_bind = "value:recurrencerule" })
        )
    </div>

2 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 01 Dec 2020, 10:25 AM

Hi Allan,

From the snippet sent I can notice that you are explicitly setting Name() for the RecurrenceEditor HTML helper. Overriding the default name which comes with the strongly typed expression (...For()) may result in binding issues as observed. That is why it should always be avoided.

Apart from that, the data_bind attribute should point to the correctly spelled field, as provided by the Scheduler event. Here is the correct definition of the editor:

@(Html.Kendo().RecurrenceEditorFor(model => model.RecurrenceRule)
        .HtmlAttributes(new { data_bind = "value:recurrenceRule" }))

If you face any further issues with the Scheduler custom editor, I would recommend you to consult the following example:

https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/scheduler/scheduler-custom-editor

Regards,
Veselin Tsvetanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Allan
Top achievements
Rank 1
Veteran
answered on 07 Dec 2020, 07:55 AM

Hi Veselin,

That was exactly what was needed. Thanks for clearing this up.

Have a nice day :-)

Tags
Scheduler
Asked by
Allan
Top achievements
Rank 1
Veteran
Answers by
Veselin Tsvetanov
Telerik team
Allan
Top achievements
Rank 1
Veteran
Share this question
or