RadScheduler - Adding events programmatically.

0 Answers 26 Views
Scheduler and Reminder
Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
Mark asked on 05 Mar 2024, 06:54 PM

I am using the radScheduler for the first time.  I am trying to bind some data to it (or even add events programmatically) that we are receiving from an RRS feed.   Is there a simple way to do this.  The Help files are more about binging a table/dataset to it.  Note, this control is used as a READ only view of events for my customers. 

 

TIA for the help

 

 

Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
commented on 05 Mar 2024, 07:47 PM

Okay, I found examples and I have this working. So, like I said I am new to this control.  I have a few other questions 

1. How do I Wrap the event so the entire title shows in the calendar (I like the automatic tooltip, but would still like to see the entire description)

2. We are importing from a RRS feed, the RRS feed has markup language in the description, is there a way to remove that information or turn on the Description to use the markup language?

3. How do make this READ ONLY, so user can only view events, but not add/edit or delete them?

 

TIA again.

Dinko | Tech Support Engineer
Telerik team
commented on 08 Mar 2024, 12:31 PM

Thank you for your interest in our RadScheduler control for WinForms. 

I would suggest checking the Data Binding section of the RadScheduler documentation so that you can get familiar with the different methods to populate the control. As for your questions:

1. May I ask you to share which element text needs to wrap as I am not sure which text you are referencing? You can share an image of that element.

2. Can you share how the appointments are created from the RSS feed? Probably you can handle the description there.

3. You can set the RadScheduler.ReadOnly property to true. This way the user will not be allowed to drag and drop appointments or add new ones.

Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
commented on 11 Mar 2024, 10:46 AM | edited

 

Thanks for the help. 

1. I am using Data Bindings now, thank, that link was very helpful.   

2. I am creating the appointments using Data Binding

    A. This is our entity class DashBoardCalendarEntity. We are pushing all our data into an IEnumerable<DashBoardCalendarEntity> (I suppose I could have use the build in "Appoinment" class, thinking about this now.  FYI, the titles are coming from the "Summary" field.

   public class DashBoardCalendarEntity
   {
      public String Summary { get; set; }
      public DateTime StartDate { get; set; }
      public DateTime EndDate { get; set; }
      public bool AllDay { get; set; }
      public string Description { get; set; }
      public string Location { get; set; }
      public string Category { get; set; }
      public EventId UniqueId { get; set; }
      public int BackgroundId { get; set; }
   }

      B. We are doing the following to BIND the data to the calendar.

      public static void BindList(this RadScheduler radScheduler, IEnumerable<DashBoardCalendarEntity> data)
      {
         SchedulerBindingDataSource dataSource = new SchedulerBindingDataSource();
         AppointmentMappingInfo mappingInfo = new AppointmentMappingInfo
         {
            Start = "StartDate",
            End = "EndDate",
            Summary = "Summary",
            Description = "Description",
            AllDay = "AllDay",
            AllowDelete = "AllowDelete",
            AllowEdit = "AllowEdit",
            UniqueId = "UniqueId",
            BackgroundId = "BackgroundId",
            Location = "Location"
         };
         dataSource.EventProvider.Mapping = mappingInfo;
         dataSource.EventProvider.DataSource = data;
         radScheduler.DataSource = dataSource;
      }

Here is a screen shot of what is happening, see how "PP23 - NY Pres" is missing the word "Primary" (no word warping). However, the tool tip text does show the full name.   One other question here.  Is there a way to CENTER the text instead of LEFT JUSTIFIED?   

Updated: I just noticed, that if I change the THEME, it does word wrap, so I think think this might be a Theme Issue with the control.

 

 

3. I don't know how I missed this.  But this doesn't allow the users to look at the details of the appointment (possible comments, etc).  I notice that we can create a custom appointment edit screen, so I might look at that....

Dinko | Tech Support Engineer
Telerik team
commented on 14 Mar 2024, 09:37 AM

Thank you for the additional details.

In general, you can only change the appointment height in the Month and Timeline view

((SchedulerMonthViewElement)this.radScheduler1.ViewElement).AppointmentHeight = 50;
((SchedulerTimelineViewElement)this.radScheduler1.ViewElement).AppointmentHeight = 50;

To center the text in the appointment, you can use the AppointmentFormatting event of the control. In the event handler, you can set the TextAligment property AppointmentElement to MiddleCenter. More information regarding this event can be found in the Formatting Appointments help article in our documentation.

As for your last scenario. Basically, double-clicking on the appointment will open the EditAppointmentDialog which contains more information for the appointment itself. You can modify its settings from the options inside the dialog. I am not sure why the edit dialog is not shown on your side. May I ask you to share how you want to edit the appointment or I am missing something from your scenario.

 

No answers yet. Maybe you can help?

Tags
Scheduler and Reminder
Asked by
Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
Share this question
or