This is a migrated thread and some comments may be shown as answers.

Timeline view not displaying appointment...

2 Answers 96 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Sherry
Top achievements
Rank 1
Sherry asked on 05 Feb 2009, 06:05 PM
I'm trying the control out and I cannot view my appointment on the timeline view even though it's displayed for every other view.  Here is my code:

 

Dim ai As New AppointmentInfo("Test", "02/05/2009 12:00:00 PM", "02/05/2009 2:00:00 PM", Telerik.Web.UI.RecurrenceState.Occurrence)

 

ai.ProviderId = 1

 

Dim al As New List(Of AppointmentInfo)

 

al.Add(ai)

 

Dim rtProviders As New ResourceType("Providers")

 

 

Dim dtProviders As New Data.DataTable("Providers")

 

dtProviders.Columns.Add(

"ProviderId")

 

dtProviders.Columns.Add(

"ProviderName")

 

dtProviders.Rows.Add(

"1", "Edward McLaughlin")

 

dtProviders.Rows.Add(

"2", "Tom McDonald")

 

rtProviders.DataSource = dtProviders

rtProviders.ForeignKeyField =

"ProviderId"

 

rtProviders.KeyField =

"ProviderId"

 

rtProviders.TextField =

"ProviderName"

 

RadScheduler1.ResourceTypes.Add(rtProviders)

 

Dim rtRooms As New ResourceType("Rooms")

 

rtRooms.AllowMultipleValues =

False

 

 

Dim dt As New Data.DataTable("Rooms")

 

dt.Columns.Add(

"RoomId")

 

dt.Columns.Add(

"Name")

 

dt.Rows.Add(

"1", "Exam Room A")

 

rtRooms.DataSource = dt

rtRooms.KeyField =

"RoomId"

 

rtRooms.TextField =

"Name"

 

rtRooms.ForeignKeyField =

"RoomId"

 

RadScheduler1.ResourceTypes.Add(rtRooms)

RadScheduler1.TimelineView.GroupBy =

"Providers"

 

RadScheduler1.TimelineView.GroupingDirection = Telerik.Web.UI.GroupingDirection.Vertical

RadScheduler1.HoursPanelTimeFormat =

"hh:mm tt"

 

RadScheduler1.DataSource = al

RadScheduler1.DataBind()

Thanks!

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 09 Feb 2009, 03:24 PM
Hi Edward,

How is your AppointmentInfo class defined? If you have used the AppointmentInfo class from the online demos, you will notice that the ForeignKeyField for the resource type should be of type int:

Class AppointmentInfo  
        Private _id As String 
        Private _subject As String 
        Private _start As DateTime  
        Private _end As DateTime  
        Private _recurrenceRule As String 
        Private _recurrenceParentId As String 
        Private _userID As System.Nullable(Of Integer)  
 

I have noticed that in the data table for the Providers resource you use strings for the ID's of the resources. I suspect that the type mismatch is the cause of the problem that you experience. Please, ensure that the ID field of the resource data table is of type int.


Greetings,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sherry
Top achievements
Rank 1
answered on 09 Feb 2009, 06:22 PM
Oh boy....the issue was that the datacolumn type was not set in my quick and dirty setup to be Int32....fixed..thanks for the help!
Tags
Scheduler
Asked by
Sherry
Top achievements
Rank 1
Answers by
Peter
Telerik team
Sherry
Top achievements
Rank 1
Share this question
or