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

problem using readonly vs not readonly slot

7 Answers 91 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Christie Admin
Top achievements
Rank 1
Christie Admin asked on 04 Apr 2014, 03:51 PM
Hi,

I create a control using a RadScheduleView and a weekview definition. People using my control pass me a collection of not readonly slot and I want to set the rest of the view as readonly. I want to know if there is a mechanism for doing this in the control.

Thank's
Alain

7 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 08 Apr 2014, 11:22 AM
Hi Alain,

There isn't built-in mechanism which achieves the required. You will have to implement it by yourself  - for example by going through the collection of the SpecialSlots and adding ReadOnly SpecialSlots to fill the gaps between the SpecialSlots and set the modified collection as SpecialSlotsSource of the ScheduleView.

Hope this helps.

Regards,
Kalin
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.

 
0
Christie Admin
Top achievements
Rank 1
answered on 08 Apr 2014, 02:56 PM
Hi Kalin,

ok great but I have another question. I want to generate the whole week as readonly, actually, I create a readonly slot for each spot reflecting the MinorTickLength for each resources. The problem I have is a performance issue during the creation process of each readonly slot. I need to keep the separator between each slot/resource.

Thank's
Alain
0
Kalin
Telerik team
answered on 09 Apr 2014, 12:34 PM
Hi Alain,

You can achieve the same by adding a single ReadOnly Slot with duration a whole week and assign all of the ScheduleView Resources to it. Please check the following code snippet for example:

var readOnlySlot = new Slot { Start = DateTime.Today, End = DateTime.Today.AddDays(7), IsReadOnly = true };
readOnlySlot.Resources.AddRange(((ResourceTypeCollection)this.ScheduleView.ResourceTypesSource).First().Resources);
this.ScheduleView.SpecialSlotsSource = new ObservableCollection<Slot> { readOnlySlot };

Hope this helps.

Regards,
Kalin
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.

 
0
Christie Admin
Top achievements
Rank 1
answered on 09 Apr 2014, 01:17 PM
Hi Kalin,

that's what I tried before your replay but as I said in my initial post, I want to preserve the separators (horz/vert) between each spots.

Thank's
Alain
0
Kalin
Telerik team
answered on 11 Apr 2014, 11:45 AM
Hi Alain,

Which separators are not visible when using that approach, could you please share a screen shot? In my test application everything looks as expected (check the attachment) - I've used Office2013 theme and WeekViewDefinition.

I'm looking forward to hearing from you.

Regards,
Kalin
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.

 
0
Christie Admin
Top achievements
Rank 1
answered on 11 Apr 2014, 12:47 PM
Hi Kalin,

what I mean by the separators it's the horizontal and vertical lines whi delimited each slots but I think's the problem come from the usercontrol I use as a background for the readonly slots but I'm not sure.

With your solution, I have a question in my mind. I posted it in an other post but maybe you can answer it through this post.

Actually I created a UserControl with a ScheduleView and my UserControl offer an "OnCanDrop" event to the user. Si I created a CustomDraDropBehavior and in the override CanDrop method, I just want to fire my event the first time I enter in a slot, not each time the mouse move inside the same slot. I figure to use the MouseOverSlot to achieve my goal because I need to inform through my event and I also need to verify if I'm still in the same slot while the mouse is moving.

With your approach, if I have 2 ressources (ie: Room1 and Room 2 and ecah ressource have a specific ID base on a derived class) at 9h15, the MouseOverSlot will return what, a Slot with both ressources or the slot I'm over it???

Thank's
Alain
0
Kalin
Telerik team
answered on 15 Apr 2014, 07:27 AM
Hi Alain,

I have already answered you the same question in the other forum thread. Could you please check my answer there and let me know if it works for you. I'll also ask you to continue the conversation there.

Regards,
Kalin
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.

 
Tags
ScheduleView
Asked by
Christie Admin
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Christie Admin
Top achievements
Rank 1
Share this question
or