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

ReadOnly Resource Groupings

12 Answers 140 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Pete
Top achievements
Rank 1
Pete asked on 31 Mar 2011, 04:23 PM
I have 2 resource groupings in my schedule; grouped by person and then by another resource type (e.g. "A" or "B").
I would like to make the "B" grouping readonly.

I have hooked into the AppointmentCreating, AppointmentDeleting and AppointmentEditing events and set e.Cancel to true for this type. This prevents the user from changing data but they can still begin a resize/move or open the Edit Appointment Dialog. I have looked through the xaml template for the scheduleview but I can't see anything I can intercept.

Thanks

12 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 01 Apr 2011, 12:57 PM
Hello,

You should create special slots for the needed resource and set their IsReadOnly property to true. The approach is described in this help article.

Best wishes,
Yana
the Telerik team
0
Pete
Top achievements
Rank 1
answered on 01 Apr 2011, 03:37 PM
Thanks. I've got this working now.
Would it be possible to put headers (above the timerulerpanel) for the slots on the day view?
e.g. Could I create an "AM" and "PM" slots with different shaded backgrounds and have headers over the top of the times?
0
Yana
Telerik team
answered on 05 Apr 2011, 10:02 AM
Hello,

Could you please send us an image which shows exactly the needed layout?  You can draw it in MS Paint, we just need a clearer view in order to provide you with a suitable solution. Thanks in advance

Best wishes,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Pete
Top achievements
Rank 1
answered on 05 Apr 2011, 11:53 AM
I've attached a sketch of what I'm trying to acheive.
I can get my control into the correct place in the scheduleview by inserting it in the template just before PART_TimeRulerPanel.
I have a control that inherits Control and contains a Canvas. I can position the elements by binding Canvas.Left to a property on the items in the control's itemsource.

The main problem I have now is calculating the position of the elements based upon the width of the timeruler when I don't fix the width of the scheduleview. The width is only available after measureoverride and arrangeoverride are called.

Do you have any ideas?
Thanks
0
Valeri Hristov
Telerik team
answered on 06 Apr 2011, 08:41 AM
Hi,

Unfortunately the information you need is calculated in MeasureOverride and cannot be obtained earlier. We are currently changing this behavior, but this change will be included in the next major release Q2 2011 in the summer. We will do our best to provide an early beta version in 4-6 weeks, when most of the features for Q2 are ready.

All the best,
Valeri Hristov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Pete
Top achievements
Rank 1
answered on 06 Apr 2011, 08:55 AM
Thanks.
Would there be any other way to achieve what I am trying to do in the image?
I tried fixing the width as a temporary solution and I managed get the items to draw. I could not get the items to scroll with the rest of the schedule however, as I presume I would have to handle this myself somehow.
0
Valeri Hristov
Telerik team
answered on 06 Apr 2011, 09:19 AM
I am sorry, we don't have a workaround for this situation and I would strongly recommend not using hacks, because they cannot be guaranteed to work, especially having in mind that we are currently changing this functionality. The fixed size timeruler seems like a good temporaty solution, though.

I don't know how did you fixed the size of the timeruler, but if you are not using the Min/MaxTimeRulerExtent properties (on a view definition), you should check them out. You just need to set them both with the same value and the timeruler will not change its length automatically.

Regarding the scrolling, RadScheduleView has several public properties that could help - ExtentWidth/Height, ViewportWidth/Height, Vertical/HorizontalOffset (the same as on a ScrollViewer).

Greetings,
Valeri Hristov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Pete
Top achievements
Rank 1
answered on 06 Apr 2011, 02:59 PM
Thanks. I have put my control in a scrollviewer and hidden the scrollbars. I am binding the scheduleViewer.HorizontalOffset property against the scrollviewer position (based on this article Exposing and Binding to a Silverlight ScrollViewer’s Scrollbars | Colin Eberhardt's Adventures in WPF) I've not got it fully working yet but I think I'm on the right tracks.
0
Pete
Top achievements
Rank 1
answered on 07 Apr 2011, 10:27 AM
I've looked at EffectivePixelLength property but the values at runtime do not seem to make sense - EffectivePixelLength.Minutes = 1, EffectivePixelLength.Hours = 1, EffectivePixelLength.Days = 0 etc. Could you explain this please?
0
Valeri Hristov
Telerik team
answered on 12 Apr 2011, 09:49 AM
The EffectivePixelLength is a TimeSpan that specifies the length in time of a pixel. Its value is calculated using the Min/MaxTimeRulerExtent. For example, if MinTimeRulerExtent=MaxTimeRulerExtent=1000, in day view the EffectivePixelLength will be 24h/1000.

All the best,
Valeri Hristov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Pete
Top achievements
Rank 1
answered on 12 Apr 2011, 04:40 PM
Thanks. Is there any property that I can use in the template to tell which view the scheduler is in? I have added an item that I only want to be visible in Day View mode.
0
George
Telerik team
answered on 15 Apr 2011, 03:36 PM
Hi Pete,

 
You could use the RadScheduleView.ActiveViewDefinition property. This property will give you the information.

I hope this helps.

All the best,
George
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ScheduleView
Asked by
Pete
Top achievements
Rank 1
Answers by
Yana
Telerik team
Pete
Top achievements
Rank 1
Valeri Hristov
Telerik team
George
Telerik team
Share this question
or