problem using readonly vs not readonly slot

8 posts, 0 answers
  1. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 04 Apr 2014 Link to this post

    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
  2. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 08 Apr 2014 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 08 Apr 2014 in reply to Kalin Link to this post

    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
  5. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 09 Apr 2014 Link to this post

    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.

     
  6. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 09 Apr 2014 in reply to Kalin Link to this post

    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
  7. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 11 Apr 2014 Link to this post

    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.

     
  8. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 11 Apr 2014 in reply to Kalin Link to this post

    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
  9. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 15 Apr 2014 Link to this post

    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.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready