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

Porting code from RadScheduler

10 Answers 322 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 10 Nov 2010, 11:05 PM
I am porting code from RadScheduler to ScheduleView.
I have few questions
1) In my code I was creating DataTemplate and binding it to the AppointmentTemplate.
I do not see this property on the ScheduleView, Can you advise how to bind it at run time?

2) All of my appointments are AllDay how can I adjust "AllDay" height on Month and Day View?

3) I do not see a IsReadOnly property on the ScheduleView anymore, How can I set it?


Best Regards,

Tom
 

10 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 11 Nov 2010, 08:45 AM
Hi Thomas,

Thank you for your interest in RadScheduleView control.

Below are answers of your questions.

1.In ScheduleView different appointments can be customized by using the AppointmentStyleSelector property of the control. For more details how to customize appointments you can review our Appointment Style example. 

2.The AllDayArea is a feature that is not included in the current version of RadScheduleView. However all-day appointments are now displayed as regular appointments and they are stretched across the tmeruler for the whole day. Is this acceptable for you? If this is not convenient enough could you give us more information why using the all day are is more convenient for you?

3.The IsReadOnly property is not included in the current version of RadScheduleView. Still you can disable adding,deleting,editing of appointments by hooking on AppointmentCreating,AppointmentEditing and AppointmentDeleting events and set e.Cancel=True. You can also disable drag and resize of appointments by using a custom DragDropBehavior. For more details about how to implement custom DragDropBehavior you can read the attached documentation.

Regards,
Rosi
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
Thomas
Top achievements
Rank 1
answered on 11 Nov 2010, 06:00 PM
Rossi,

Thanks a lot for quick response.

Unfortunately, my client likes the way Weekly and Monthly was presented by RadScheduler. We had a problem with 'extending' section on Monthly View due to fact it was not really supported (Uniform Grid issue). This problem got resolved in RadScheduleView, which we love.

But, now we are having issue with Month and Week View since AllDay area is not supported there

So for now, we need to used both controls, but we found a problem with EventArgs being with Telerik.Windows.Controls namespace which makes impossible to have both references in the same project.

Btw, We could use a "All Day" feature from RadScheduler in the ScheduleView

Another question ScheduleView;

I am using and setting AppointmentSyleSelector at runtime and want to adjust Appointment Heigh( which can change based on the how many elements I am binding).

I am using this code and it looks like Height of Appointment is fixed and can not be changed.
Template is at fixed heigh shows only first line.

Appointment -> Starts at 00:00 and Ends at 24:00 is Marked as Not FUllDay Event, because it doen not display on the Calendar if set as AllDay. ???



       <Style x:Key="monthlyRegionView" TargetType="telerik:AppointmentItem">
            <Setter Property="Height" Value="150" />  HardCodedValue
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type telerik:AppointmentItem}">
                        <Border
                            DataContext="{Binding Appointment,Mode=OneTime}"
                            BorderBrush="{TemplateBinding BorderBrush}"
       BorderThickness="{TemplateBinding BorderThickness}"
       Background="{Binding DistrictColor}" CornerRadius="2" >
                      <StackPanel Height="150" >
                                <StackPanel Orientation="Horizontal" >
                                    <Image Visibility="{Binding HasStages, Converter={StaticResource visibilityConverter}}" Source="{StaticResource Stages}"  />
                                    <TextBlock Text="{Binding Job.CustomerName}" Margin="5,0,0,0"  />
                                </StackPanel>
                                <TextBlock Text="{Binding Job.ServiceLineName}" Margin="5,0,0,0"  />
                            </StackPanel>                        
                        </Border>
    
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <local:MonthlyAppointmentStyleSelector x:Key="cSelector"
                                          MonthlyDistrict="{StaticResource monthlyDistrictView}"    
                                          MonthlyRegion="{StaticResource monthlyRegionView}"    
                                               />

Can you advise us what to do?

Caputure.jpg - Expected behaviour Weekly Daily View -ALL Days Appt
Caputure2.jpg - Can not adjust Appt Height ScheduleView (Month)

Update: Found another issue, I assume it uses same way as RadScheduler to get VisibleStart and End based on View/ActiveView PropertyChanged Event.

But, It does not work, this event never gets fired with changing date range at date/time picker located at top of the screen.

    ....
       this.scheduler.ActiveViewDefinition.PropertyChanged+=new  PropertyChangedEventHandler (ActiveViewDefinition_PropertyChanged);
        }

 

        private void ActiveViewDefinition_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            //if(e.PropertyName=="VisibleDateStart")
            //this is never fired
            throw new NotImplementedException();

        }



Is there any other event I can subscribe to lisen for Start/End Range change?




Thanks Tom



0
Rosi
Telerik team
answered on 15 Nov 2010, 10:44 AM
Hi Thomas,

Thank you for the feedback. Below are my comments on the issues that you described:

So for now, we need to used both controls, but we found a problem with EventArgs being with Telerik.Windows.Controls namespace which makes impossible to have both references in the same project.

1.To resolve conflict between namespaces you can use aliases.  Please follow the link below for more details:
http://www.switchonthecode.com/tutorials/csharp-snippet-the-many-uses-of-the-using-keyword


Appointment -> Starts at 00:00 and Ends at 24:00 is Marked as Not FUllDay Event, because it doen not display on the Calendar if set as AllDay.
2.As for the all day appointments that are not rendered if you set their IsAllDayEvent property -this seems like a bug in RadScheduleView that we will do our best to address  in our internal builds.

I am using and setting AppointmentSyleSelector at runtime and want to adjust Appointment Heigh( which can change based on the how many elements I am binding).
3.Note that RadScheduleView has MinAppointmentHeight and MinAppointmentWidth properties - you should change them in order to change the size of appointment items.

 Found another issue, I assume it uses same way as RadScheduler to get VisibleStart and End based on View/ActiveView PropertyChanged Event.
4.Currently there isn't an event that you can hook on to implement your task. We will include such an event in the next versions. At this stage you can implement Start and End properties to the ViewModel that you have bound to the control . Then you can bind these properties to VisibleRangeStart and VisibleRangeEnd properties of the control and listen when their values will change.

Regards,
Rosi
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
Jim
Top achievements
Rank 1
answered on 13 Feb 2011, 06:43 PM
I have the same problem trying to use both scheduler and scheduleview to minimize the impact to my application.
I have tried every possible combination of the  alias suggestion to resolve conflict on eventargs.
Because the extension to telerik.windows.controls is within telerik.windows.controls.scheduleview and .scheduler I have not been able to limit the alias to only scheduleview in the scheduler implentation.
Can you give an example that works?
Thanks

Jim Wolf

0
Rosi
Telerik team
answered on 17 Feb 2011, 12:45 PM
Hello Jim,

Please find the attached project.

To achieved the goal you have to set alias of Telerik.Windows.Controls.Scheduler dll and also inherit RadScheduler.

Do not hesitate to contact us if you have any additional questions.

All the best,
Rosi
the Telerik team
0
Jim
Top achievements
Rank 1
answered on 17 Feb 2011, 07:15 PM
Thanks I will try it and let you know. I read there was a detailed application note on moving from scheduler to schedule view in particular regarding timeslots etc. Does such a document exist?

Thanks again.

Jim Wolf
0
Jim
Top achievements
Rank 1
answered on 17 Feb 2011, 09:01 PM
This solution was close to my attempts but reversed. Still no luck. I have a complete project package .zip showing the error but its 350Mbytes.Here is a screen shot. Its probably something obvious but Im not getting it.

THanks

Jim
0
Rosi
Telerik team
answered on 18 Feb 2011, 01:45 PM
Hi Jim,

I suggest you check the following things:

1. If you use set properties or hook to events of RadScheduleView in xaml I suggest you use a custom control that inherits RadScheduleView instead of the RadScheduleView itself.
For more details why this is needed you can follow the link below:

http://stackoverflow.com/questions/3815492/external-alias-in-xaml


2.Define the event args in code behind by using the alias:

scheduleview.Telerik.Windows.Controls.AppointmentAddingEventArgs

Kind regards,
Rosi
the Telerik team
0
Paul
Top achievements
Rank 1
answered on 23 Feb 2011, 04:13 PM
If anyone else is having problems with this, there is a very annoying bug in VS 2010.  You cannot do this if you reference your own project in your xmlns namespaces in the XAML.  So unfortunately I cannot use ScheduleView and Scheduler together.  I'm hoping an all day option is added to ScheduleView as I can't use it without this.

http://stackoverflow.com/questions/2502640/the-extern-alias-xxx-was-not-specified-in-a-reference-option/
https://connect.microsoft.com/VisualStudio/feedback/details/615953/reference-aliases-are-ignored-on-projects-containing-some-xaml-files
0
Rosi
Telerik team
answered on 23 Feb 2011, 04:33 PM
Hello Paul,

We will do our best to include an All-day area feature in RadScheduleView control for our Q2 2011 release.

All the best,
Rosi
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
ScheduleView
Asked by
Thomas
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Thomas
Top achievements
Rank 1
Jim
Top achievements
Rank 1
Paul
Top achievements
Rank 1
Share this question
or