C1Schedule - Get Rid of Times For All Day Appointments

Posted by: mwebster on 31 January 2020, 5:37 am EST

    • Post Options:
    • Link

    Posted 31 January 2020, 5:37 am EST

    Hello,

    I have been working with C1Schedule using VB and Winforms. I followed the instructions in this post to set my appointments as “all day”.

    https://www.grapecity.com/componentone/docs/win/online-schedule/websearch.html?query=alldayevent

    I inserted this XML string into the database field that I mapped to the Appointment Properties mapping:

    True

    It seems to do exactly nothing though. The time for these all day events still shows as 12:00:00 AM - 12:00:00 AM on the month view and on the day view it stacks all schedule items on the 12:00 AM line. I can hide the times on the month view using these statements:

        C1Schedule1.Theme.ShowTimeMonthView = False
        C1Schedule1.Theme.ShowEndTimeMonthView = False
    

    It does not really make the appointments “all day” though. What am I missing?

    Thanks,

    Mike

  • Posted 31 January 2020, 5:41 am EST

    Sorry - here is the link to the post with the instructions to make appointments all day:

    https://www.grapecity.com/forums/winforms-edition/c1schedule---set-how-do-i-#original-post

  • Posted 31 January 2020, 6:21 am EST

    I just did a quick test. After loading my appointments with the property mapping and the shown XML code, I checked to see if any of them were indeed set as “all day” and none of them were despite having this as the value of the properties field I mapped to:

    True

  • Posted 2 February 2020, 8:35 pm EST

    Hi Mike,

    Sorry but we can not replicate the issue at our end and AllDayEvent set in the property field is working fine too.

    Please see the attached GIF for reference.

    It will be very helpful if you could give a sample with the dummy data replicating the issue so that we can replicate the issue at our end and provide you a solution.

    Regards,

    Prabhat Sharma.

  • Posted 3 February 2020, 12:15 am EST

    I have replicated that precisely (as bet as I can tell as the gif is just about impossible to read the text). I am not creating appointments in the schedule, I am loading them into the schedule from the database. I used the code shown above and the value shown above in the “properties” field and it does not produce an error but it does not actually do anything. The Appointments still show as 12:00:00 AM - 12:00:00 AM. I am wondering if more values must be included in the XML block other than just:

    True

    Thanks,

    Mike

  • Posted 3 February 2020, 10:15 pm EST

    Hi Mike,

    The sample with the database file shown in the last GIF is attached here and it is working fine as expected.

    Please have a look into the sample and let us know if you could replicate the issue with that.

    If you are doing something else then please modify the sample accordingly replicating the issue, so that we can assist you in a better way.

    Regards,

    Prabhat Sharma.

    ScheduleAllDayEventDemo.zip

  • Posted 6 February 2020, 1:08 am EST

    Ok, there is definitely some sort of bug here. I took your example and created a VB app using the exact same code that I am using and your Access database. Ran it and it worked. Converted the same database to SQL server and it once again ignored the AllDayEvent property. I even changed my app so that if I dragged an appointment into the “all day” area of the Day view it would save the Properties value back into the database. When I reloaded the form, it once again ignored the AllDayEvent property and displayed the appointment as being 12:00 AM. I believe that the problem is somehow related to using SQL Server as the datasource.

    To reproduce the problem, do this:

    1. Create a SQL Database with a schedule table containing the columns in your Access sample. Add the same sample records as you have in the Access Database.

    2. Create a VB.NET Windows Forms App.

    3. Add a form and add a Schedule Control to it.

    4. Create a Dataset.

    5. Add a Table Adapter

    6. Add this code to the form’s on load event:

       Dim ScheduleTable As New DataTable
       Dim ScheduleAdapter As New DataSet1TableAdapters.AppointmentTableAdapter
       ScheduleTable = ScheduleAdapter.GetData
       C1Schedule1.DataStorage.AppointmentStorage.Mappings.AppointmentProperties.MappingName = "Properties"
       C1Schedule1.DataStorage.AppointmentStorage.Mappings.Subject.MappingName = "Subject"
       C1Schedule1.DataStorage.AppointmentStorage.Mappings.Start.MappingName = "Start"
       C1Schedule1.DataStorage.AppointmentStorage.Mappings.End.MappingName = "End"
       C1Schedule1.DataStorage.AppointmentStorage.Mappings.Body.MappingName = "Body"
       C1Schedule1.DataStorage.AppointmentStorage.Mappings.Location.MappingName = "Location"
       C1Schedule1.DataStorage.AppointmentStorage.DataSource = ScheduleTable
      

    Run the app. The appointments will show up as 12:00AM instead of “all day”. As soon as you switch to SQL Server and load the appointments from that database, they no longer come in as “AllDayEvents”

    Follow the same procedure with an Access database and run it and it works fine.

  • Posted 6 February 2020, 5:33 pm EST

    Hi Mike,

    We used the same table definition with SQL Server and your given mapping code snippet but we could not observe any issues.

    See the attached GIF file for our observations:

    [Open the GIF file in a new tab to see it in better resolution]

    Can you please mention the build you are using so we can check it against that also?

    Thanks,

    Jitender

  • Posted 7 February 2020, 12:00 am EST

    I am using Visual Studio 2019, VB, Winforms Project with version 20193.1.393 of the C1 Winforms library. I figured out what the problem is. There is a bug in the component that causes it to ignore the “AllDayEvent” tag if the start date and end date are the same day. If you make the end date anything later than the start date, it works fine. If you make them the same, it ignores the “AllDayEvent” setting. I tired that with your example it it behaved the same with Access as well as SQL and exhibited the same behavior that I observed.

  • Posted 9 February 2020, 3:16 pm EST

    Hi Mike,

    Thanks for the information. I’ve reported the issue to the developers [Internal Tracking ID: 420334]

    I’ll let you know once there is a fix available for this.

    Regards,

    Jitender

  • Posted 17 March 2020, 3:35 pm EST

    Hi Mike,

    This issue has been fixed in the latest builds (2020 v1).

    You can download the builds from following link:

    http://prerelease.componentone.com/dotnet40/c1winforms/2020-t1/C1WinForms.4_4.0.20201.416.zip

    Regards,

    Jitender

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels