Telerik Forums
UI for ASP.NET Core Forum
1 answer
25 views

Hi, I tried a lot of things and code i found here in the forum and in the documentations, but everything i found is for Jquery and it isnt working for .net core.

I have some checbkox to filter and show/hide the resources of my scheduler. The filtering is working, but i cant hide/show the selected/unselected resources.

Until the line 'scheduler.dataSource.filter(filter);' all is working fine, filtering the events. But i dont want to have the columns of the resources that arent selected... I found in a lot of topics that for that, i need the line 'scheduler.view(scheduler.view().name)' but is not working.

I found that for filter the datasource some people use 'scheduler.resources[0].dataSource.filter(filter);' but is not working for me, im using 'scheduler.dataSource.filter(filter)'.

How could i get that functionality? I need it... because i have a lot of 'medicos' resources and is impossible to visualize the scheduler with all.. i only need the selected ones.

Thanks in advance!

 

$("#medicosCheck :checkbox").change(function (e) {
    var checked = $.map($("#medicosCheck :checked"), function (checkbox) {
        return parseInt($(checkbox).val());
    });

    var filter = {
        logic: "or",
        filters: $.map(checked, function (value) {
            return {
                operator: "eq",
                field: "IdMedico",
                value: value
            };
        })
    };

    var scheduler = $("#citas").data("kendoScheduler");
    scheduler.dataSource.filter(filter);
    //scheduler.view(scheduler.view().name);
});

 

Ivaylo
Telerik team
 answered on 24 Mar 2025
1 answer
105 views

I am looking at using the scheduler control (Restrictions in ASP.NET Core Scheduler Component Demo | Telerik UI for ASP.NET Core)

I see there are various ways to restrict appointments, is there a way to do so where certain dates would not allow appointments?  I need to restrict holidays and other specific dates from containing appointments.  

Also, is there a way to restrict appointmetns to specific business hours.  In the demo it has a button to Show Business Hours but appointments don't seem to be restricted to those hours - I was able to schedule one outside of business hours.

Last, is there a way to note certain dates with a specific background color? I want holidays to be clearly shown so it's easier on the user.

Thanks!

 

Ivan Danchev
Telerik team
 answered on 10 Sep 2024
1 answer
96 views

Hello,

I've got a RazorPages-Project with a Grid and a Scheduler.

I'm trying to add entries to the grid inline.

The simple text fields are working as expected but when trying to save the DateTime for Start and End, always the min value of DateTime is ending up being in the Start and End fields of the model. Moreover the list of enums is not shown correctly, I also tried it with a JS function to get the list in a ClientTemplate but that didn't work for me, now it shows [object Object]. Also the DefaultValue for title property is not set correctly. This is what I got so far.

Model:

    public class VisitViewModel : ISchedulerEvent
    {
        public int Id { get; set; }

        public string? Title { get; set; } = "";

        public string? Description { get; set; } = "";

        public bool IsAllDay { get; set; } = false;

        public string? StartTimezone { get; set; } = "";

        public string? EndTimezone { get; set; } = "";

        public string? RecurrenceRule { get; set; } = "";

        public string? RecurrenceException { get; set; } = "";

        public List<Departments>? Departments { get; set; } = new List<Departments>();

        [DataType(DataType.DateTime)]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd.MM.yyyy HH:mm}")]
        public DateTime Start { get; set; }

        [DateGreaterThan(OtherField = "Start")]
        [DataType(DataType.DateTime)]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd.MM.yyyy HH:mm}")]
        public DateTime End { get; set; }

        public string Visitor { get; set; } = "";

        public string Company { get; set; } = "";

        public string Welcomer { get; set; } = "";
    }


Page:

@page
@model           .Pages.DetailsModel

@{
}

@using           .Data.Enum
@using           .ViewModels
@using Kendo.Mvc.UI

@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf
@Html.AntiForgeryToken()


@(
Html.Kendo().Grid<VisitViewModel>()
            .Name("grid")
            .Editable(e => e.Mode(GridEditMode.InLine))
            .Scrollable(scrollable => scrollable.Endless(true))
            .Scrollable(a => a.Height("250px"))
            .ToolBar(x => x.Create())
            .Columns(columns =>
            {
                columns.Bound(column => column.Start).Width(250).Format("{0:dd.MM.yyyy HH:mm}").EditorTemplateName("DateTime");
                columns.Bound(column => column.End).Width(250).Format("{0:dd.MM.yyyy HH:mm}").EditorTemplateName("DateTime");
                columns.Bound(column => column.Visitor).Width(250);
                columns.Bound(column => column.Company).Width(250);
                columns.Bound(column => column.Welcomer).Width(250);
                columns.Bound(column => column.Departments).EditorTemplateName("Departments");
                columns.Bound(column => column.Description);
                columns.Command(column =>
                {
                    column.Edit();
                    column.Destroy();
                }).Width(230);
            })
            .DataSource(ds => ds.Ajax()
            .Read(r => r.Url("/Details?handler=Read").Data("forgeryToken"))
            .Update(u => u.Url("/Details?handler=Update").Data("forgeryToken"))
            .Create(c => c.Url("/Details?handler=Create").Data("forgeryToken"))
            .Destroy(d => d.Url("/Details?handler=Destroy").Data("forgeryToken"))
            .Model(m =>
            {
                m.Id(id => id.Id);

                m.Field(visit => visit.Title).DefaultValue("");

                m.Field(visit => visit.Departments).DefaultValue(new List<Departments>());

                m.Field(visit => visit.StartTimezone).DefaultValue("Etc/GMT+2");
                m.Field(visit => visit.EndTimezone).DefaultValue("Etc/GMT+2");

                m.Field(visit => visit.Start).DefaultValue(DateTime.Now);
                m.Field(visit => visit.End).DefaultValue(DateTime.Now);
            })
            .PageSize(5)
            )
            .Pageable()
)
@(
Html.Kendo().Scheduler<VisitViewModel>()
            .Name("scheduler")
            .Height(700)
            .DataSource(ds =>
            {
                ds.Read(r => r.Url("/Details?handler=Read").Data("forgeryToken"));
                ds.Update(u => u.Url("/Details?handler=Update").Data("forgeryToken"));
                ds.Create(c => c.Url("/Details?handler=Create").Data("forgeryToken"));
                ds.Destroy(d => d.Url("/Details?handler=Destroy").Data("forgeryToken"));
            })
)



<script type="text/javascript">
    function forgeryToken() {
        return kendo.antiForgeryTokens();
    } 
</script>

PageModel:

public class DetailsModel : PageModel
{
    private readonly          Context _context;

    public DetailsModel(         Context context)
    {
        _context = context;
    }

    public void OnGet()
    {
    }

    public override void OnPageHandlerExecuting(PageHandlerExecutingContext context)
    {
        CultureInfo.DefaultThreadCurrentCulture = CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("de-DE");

        base.OnPageHandlerExecuting(context);
    }

    public JsonResult OnPostRead([DataSourceRequest] DataSourceRequest request)
    {
        return new JsonResult(_context.VisitViewModels.ToDataSourceResult(request));
    }

    public JsonResult OnPostCreate([DataSourceRequest] DataSourceRequest request, VisitViewModel visit)
    {
        _context.VisitViewModels.Add(visit);
        _context.SaveChanges();

        return new JsonResult(new[] { visit }.ToDataSourceResult(request, ModelState));
    }

    public JsonResult OnPostUpdate([DataSourceRequest] DataSourceRequest request, VisitViewModel visit)
    {
        _context.VisitViewModels.Update(visit);
        _context.SaveChanges();
        return new JsonResult(new[] { visit }.ToDataSourceResult(request, ModelState));
    }

    public JsonResult OnPostDestroy([DataSourceRequest] DataSourceRequest request, VisitViewModel order)
    {
        _context.VisitViewModels.Remove(order);
        _context.SaveChanges();
        return new JsonResult(new[] { order }.ToDataSourceResult(request, ModelState));
    }
}

EditorTemplate DateTime

@model DateTime?

@(Html.Kendo().DateTimePickerFor(m => m).HtmlAttributes(new { title = Html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName("") }).Format("{0:dd.MM.yyyy HH:mm}"))

Furthermore I have problems with the language in my project, maybe this correlates. They are mixed up as you can see in the attachment.

 

Mihaela
Telerik team
 answered on 23 Jul 2024
0 answers
57 views
How to use WorkWeekStart and what does it do? What are the valid integer values? 0 to 6? 1 to 7? The month view is rendered Sunday to Saturday... If I need to display Monday to Sunday would the changing the WorkWeekStart help? It doesn't seem to do anything.
Francis
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 20 Feb 2024
2 answers
416 views

Hello,

can be hidden Saturdays and Sundays from the scheduler control in all views and how?

Many thanks!

 

Michel
Top achievements
Rank 1
Iron
 answered on 27 Aug 2023
1 answer
316 views

Using the ASP.NET Core Scheduler Component, I am trying to implement a CustomView. However, the link below doesn't contain any concrete example.

https://docs.telerik.com/aspnet-core/html-helpers/scheduling/scheduler/views#custom-views

Thanks.

 

Alexander
Telerik team
 answered on 07 Aug 2023
1 answer
113 views

Hi,

 

using Telerik Asp Net Core version 2022.2.621

I have a problem with the UI of the Scheduler, when trying to display 15 mins events.  The widget contains typically 30 mins to 1 hour events, occasionally, there are  15 mins events, in which case after the 15 mins event the next event is pushed to the right.  How to prevent that kind of behavior without changing the Major Ticks configuration. 

Changing the Major Ticks configuration will cause a problem in the UI because normal classes are 1 hour length. 

 

Mihaela
Telerik team
 answered on 17 Jul 2023
1 answer
251 views

I had a look at the ISchedulerEvent inside the Kendo.MVC.UI namespace and found that it's using predefined binding for column names such as Title, Description, Start, End, etc.

However, I have a data controller and model that has some of those, but I have many other data columns that I need mapped to a Telerik Scheduler-Timeline control.

Is it possible to edit the ISchedulerEvent to allow other columns? I have data that eventually I will need to show up in the Scheduler as a tooltip (custom javascript I can see already here, but very little documentation on how in your website). And how do I customise the CSS too please? I want to change the way the MonthView displays data, down to 12hr blocks per day for a max of 7 days in the one screen.

Also, I noticed the following errors/messages when viewing the control source code:

namespace Kendo.Mvc.UI
{
    public interface ISchedulerEvent
    {
        string Title { get; set; }

        string Description { get; set; }

        bool IsAllDay { get; set; }

        DateTime Start { get; set; }

        DateTime End { get; set; }

        string StartTimezone { get; set; }

        string EndTimezone { get; set; }

        string RecurrenceRule { get; set; }

        string RecurrenceException { get; set; }
    }
}
#if false // Decompilation log
'325' items in cache
------------------
Resolve: 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Found single assembly: 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Load from: 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\7.0.5\ref\net7.0\System.Runtime.dll'
------------------
Resolve: 'Microsoft.AspNetCore.Mvc.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
Found single assembly: 'Microsoft.AspNetCore.Mvc.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
Load from: 'C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\7.0.5\ref\net7.0\Microsoft.AspNetCore.Mvc.Abstractions.dll'

What does this mean? I am using .Net 6 not .Net 7.

Obviously, I am new to ASP.Net Core but I am familiar with the EntityFramework to get data from a SQL Server database. I know that part of my project is working, but I am having a hard time understanding the ISchedulerEvent  and why I have to use it, and how to use it to customise my data mappings.

Please don't offer me the Scheduler getting-started-scheduler page. I've done all that and it's very thin on explaining how things are working, and besides the model in the example is purely limited to the existing columns in the ISchedulerEvent  .

Thanks

Alexander
Telerik team
 answered on 11 Jul 2023
1 answer
161 views

I am relatively new to ASP.Net core (.net6) and I am trying to bind the Kendo scheduler with my existing data source.

Background: I am tasked with replacing outdated javascript tools for our "shipping scheduler", which is very similar to the Telerik Scheduler Timeline view.

Here is an example of what I am trying to achieve...

 

The data source is a simple API source from the web (for example https://mydomain.com/datasource), with the following structure:

 

namespace ShippingSchedulerApp.Models
{
    public class SchedulerEvent
    {
        public long ID { get; set; }
        public DateTime? start_date { get; set; }
        public DateTime? end_date { get; set; }
        public string? text { get; set; }
        public string? shipclass { get; set; }
        public decimal? beam { get; set; }
        public string? sectionID { get; set; }
        public string? flag { get; set; }
        public string? country { get; set; }
        public string? visitnumber { get; set; }
        public int? visitid { get; set; }
        public int? imo { get; set; }
        public string? details { get; set; }
        public string? cargo { get; set; }
        public decimal? duration { get; set; }
        public decimal? loa { get; set; }
        public string? stevedore { get; set; }
    }
}

If someone could point me to a demo or a sample way of connecting the above to the Telerik Scheduler Timeline view, that would be great.

Thanks

 

Stoyan
Telerik team
 answered on 15 Jun 2023
5 answers
323 views

I find myself having a heck of a time getting started with the scheduler. Is there a SIMPLE getting started example that explains how to use the scheduler? All I am looking to do is to have a monthly view and be able to display availability of items. An item could be, for example, a room at a hotel. I won't be doing anything more granular than day level scheduling. I want to block out a date on the calendar for an item. That's it. Once I can figure out how to do that, I can dig deeper myself.

Any guidance would be greatly appreciated.

Stoyan
Telerik team
 answered on 15 Jun 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?