Print Page | Close Window

Events not visible when calendar resource is used.

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=7915
Printed Date: 23 November 2024 at 11:40am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Events not visible when calendar resource is used.
Posted By: Nataraj
Subject: Events not visible when calendar resource is used.
Date Posted: 01 September 2007 at 6:55am
Hi,
Iam using calendar control 10.3. Iam using the following code to show the name of the resource in the header. But when i add the id to the scheduleids collection i no longer see the events.
 
   Dim loNewEvent As CalendarEvent, loCalendarEvent As CalendarEvent
    Dim loSchedules As CalendarSchedules
    Dim loCalendarResource As CalendarResource
   
    With CalendarControl1
        .DataProvider.Create
        Set loCalendarResource = .MultipleResources(0)
       
        Set loNewEvent = loCalendarResource.DataProvider.CreateEvent
        loNewEvent.Subject = "Test event"
        loNewEvent.StartTime = Now
        loNewEvent.EndTime = DateAdd("n", 30, loNewEvent.StartTime)
        loCalendarResource.DataProvider.AddEvent loNewEvent
       
        Set loSchedules = loCalendarResource.DataProvider.Schedules
        loSchedules.AddNewSchedule "First"
        loCalendarResource.Name = "My resource"
        loCalendarResource.ScheduleIDs.Add loSchedules.Item(0).Id
        .Populate
        .RedrawControl
    End With
 
if i comment the line loCalendarResource.ScheduleIDs.Add loSchedules.Item(0) then iam able to see the event but not the header.
 
what is wrong in the above code which prevents the event from being displayed. When i use the getevent method to retrieve the event i get and instance of the event. So iam sure that the event is there in memory but not visible.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net