Setting colors for events

4 posts, 0 answers
  1. Jazeel
    Jazeel avatar
    3 posts
    Member since:
    Feb 2015

    Posted 12 Mar 2015 Link to this post

    Hi,

    We need to set different colors for different events based upon a status value (Approve/Reject) dynamically.
    We tried the sample on your site. 
    .Resources(resource =>
    {
    resource.Add(m => m.OwnerID)
    .Title("Owner")
    .DataTextField("Text")
    .DataValueField("Value")
    .DataColorField("Color")
    .BindTo(new[] {
    new { Text = "Alex", Value = 1, Color = "#f8a398" } ,
    new { Text = "Bob", Value = 2, Color = "#51a0ed" } ,
    new { Text = "Charlie", Value = 3, Color = "#56ca85" }
    });
    })
    But our requirement is to load datasource for resource dynamically with StatusId and StatusColor.

    Thanks,
    Jazeel
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 13 Mar 2015 Link to this post

    Hello Jazeel,

    Please note that the "Resources" of the Scheduler support configuring regular DataSource (the same way as the Scheduler) for loading data from remote source:

    .Resources(resource =>
    {
        resource.Add(m => m.OwnerID)
            .Title("Owner")
            .DataTextField("Text")
            .DataValueField("Value")
            .DataColorField("Color")
            .DataSource(ds => ds
                .Read("ReadOwners", "Home"));

    Regards,
    Vladimir Iliev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Jazeel
    Jazeel avatar
    3 posts
    Member since:
    Feb 2015

    Posted 19 Mar 2015 in reply to Vladimir Iliev Link to this post

    Hi Vladimir,

    Thanks it worked.

    Is there any option to set the font color for events dynamically?
    Is there any option to select date using javascript?

    Thanks & Regards,
    Jazeel
  5. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 19 Mar 2015 Link to this post

    Hi Jazeel,

    Straight to your questions:

    1) You can define custom "EventTemplate" (using Kendo UI templates) to customize the look of the events.
    2) If you need to change the date you can use the Scheduler "date" method:


    Regards,
    Vladimir Iliev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET MVC is VS 2017 Ready