Custom Appointments and Appointment Template

21 posts, 1 answers
  1. Daniel Varrin
    Daniel Varrin avatar
    18 posts
    Member since:
    Oct 2009

    Posted 14 Oct 2011 Link to this post

    Hi,

    I'm trying to integrate a RadScheduleView control in a Lightswitch application.

    I want to be able to specify an additional parameter for an appointment in the creation dialog. It should appear as a dropdown-list in which one I can select a value (for example a list of contacts).

    I would like to have that new parameter being validated too.

    Then I want that contact name to be displayed for each appointments on the scheduleview.

    How can I do that?

    What I did now, instead of creating a custom Appointment class, is to use a new resource type. When I do like this the dropdown-list appears in the Appointment dialog and I can select a contact name. But I cannot do the validation and I cannot display it on the scheduler.

    1)  But now how do I display that contact name on the AppointmentItem template?

    2) Is it the right way to do it with resources, or should I create a custom Appointment class? If yes, would it be possible to have a example (I don't know how to create the dropdown-list in the appointment dialog?

    The problem is also that, as it is a Lightswitch application, I've to do the data binding in the code. If for example I add a dropdownlist control to the appointment dialog template, how do I bind the list of contact to that control using code?

    I hope you can help me ;-) The demo for Custom Appointments doesn't contain the needed code :-((

    Daniel
  2. Daniel Varrin
    Daniel Varrin avatar
    18 posts
    Member since:
    Oct 2009

    Posted 14 Oct 2011 Link to this post

    Has anybody an example using:
    1) a Custom Appointment class
    2) and with an appointment dialog template in which one there is at least a dropdown-list
    3) and validation for the new attributes of the custom Appointment class
    4) and an example of how to display the new atrtributes on the appointmentItem template

    ??

    For the dropdown_list used to choose the value for the new attribute, how do I set the content of the list by code?
    I'm using Lightswitch and I cannot do it with data binding, because the items are entities in my application.
  3. DevCraft banner
  4. Daniel Varrin
    Daniel Varrin avatar
    18 posts
    Member since:
    Oct 2009

    Posted 14 Oct 2011 Link to this post

    I've created a custom Appointment class and updated the dialog template so that it contains a RadcomboBox.

    How can I set the content of that combobox from the code behind of my UserControl which contains the RadscheduleView?
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 19 Oct 2011 Link to this post

    Hello Daniel,

    I would suggest to bind the combobox to a property in your ViewModel as described in this help article.

    Greetings,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Daniel Varrin
    Daniel Varrin avatar
    18 posts
    Member since:
    Oct 2009

    Posted 19 Oct 2011 Link to this post

    Hi,

    Thank you for your answer. Unfortunately, I'm using the RadScheduleView in a LightSwitch application and I think I cannot use a viewmodel.

    I've seen that it is possible to find a control with a specified name contained in a template using a "Findxx" method. I haven't tried this solution, yet.
  7. Answer
    Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 20 Oct 2011 Link to this post

    Hello Daniel Varrin,

    We are sorry for the misunderstand.

    You can find attached a sample example that includes:
    1. Custom appointment
    2. Custom EditAppointmentDialog
    3. Validation
    4. Custom AppointmentItemContentTemplate
    5. Lightswitch
    Do not hesitate to contact us should you have any questions.

    Best wishes,
    Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  8. Daniel Varrin
    Daniel Varrin avatar
    18 posts
    Member since:
    Oct 2009

    Posted 20 Oct 2011 Link to this post

    Thank you so much Ivo for the sample project!! :D
    Exactly what I wanted :-)

    Great thanks!
    Daniel
  9. Qloud Pty Ltd
    Qloud Pty Ltd avatar
    17 posts
    Member since:
    Sep 2011

    Posted 09 Nov 2011 Link to this post

    Hi Ivo,

    Thank You. Great Example with complete code. We are facing few errors when converting in to VB using Telerik Converter.

    How to add a label next to Products dropdown?

    could you please provide VB code ASAP.

    Best Regards
    Rama
  10. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 14 Nov 2011 Link to this post

    Hi Rama,

    You can find the VB example attached.

    Kind regards,
    Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  11. Cliff McManus
    Cliff McManus avatar
    32 posts
    Member since:
    Mar 2011

    Posted 20 Dec 2011 Link to this post

    This is really good stuff. Thanks for the examples.
    I however am still having a problem. I would like to add buttons to the ScheduleView control to do things.
    I have the XAML from the examples I can get things to show up but cannot for the life of me figure out how to integrate the Custom Appointment logic to implement clicks for things like the Today button. I assume that I need to set up a View Model for this, it is complicated by the fact that I am using LightSwitch as the development platform.

    Could you please provide a sample using Lightswitch that includes a radribbon bar.
    Regards
    Cliff
  12. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 23 Dec 2011 Link to this post

    Hi,

    You can find an example with RadScheduleView and RadRibbonView in LightSwitch attached. The key thing you missed was the ViewModel as you suspected.

    Regards,
    Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  13. Qloud Pty Ltd
    Qloud Pty Ltd avatar
    17 posts
    Member since:
    Sep 2011

    Posted 23 Dec 2011 Link to this post

    Hi Ivo,

    The example was unable to load categorize and  Time markers. groub by Functionality is now working.

    Please find the attached sceen shot for your reference.

    Regards
    Rama
  14. Dani
    Admin
    Dani avatar
    848 posts

    Posted 27 Dec 2011 Link to this post

    Hi Rama,

    It seems you are missing content templates for the categories and time markers. Please, add a header template to your RadMenuItems in the following manner:
    <telerik:RadMenuItem HeaderTemplate="{StaticResource CategoryHeaderTemplate}" Command="{Binding SetCategoryCommand, Source={StaticResource ViewModel}}"    CommandParameter="{Binding Header, RelativeSource={RelativeSource Self} }">
    ...
    </telerik:RadMenuItem>

    And the templates:
    <DataTemplate x:Key="CategoryHeaderTemplate">
                <TextBlock Text="{Binding DisplayName}" />
    </DataTemplate>

    <DataTemplate x:Key="TimeMarkerHeaderTemplate">
                <TextBlock Text="{Binding TimeMarkerName}" />
    </DataTemplate>

    I hope this helps.


    Regards,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  15. Cliff McManus
    Cliff McManus avatar
    32 posts
    Member since:
    Mar 2011

    Posted 28 Dec 2011 Link to this post

    Thanks for the sample. I am sure I can get it to work with this.
    I downloaded the sample and changed the references in Client and ClientGenerated to point to my copy of the Telerik DLLS.

    However i am getting the following errors . I am pretty new to development so it is probably an easy fix. Both are in the
    public partial class RadScheduleViewControl : System.Windows.Controls.UserControl Class File

    Error 1 The type or namespace name 'RadScheduleView' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Cliff\Desktop\Lightswitch Training\Telerick\ScheduleViewWithViewModel\Client\obj\Debug\RadScheduleViewControl.g.i.cs 40 18 Client

    Error 2 Metadata file 'C:\Users\Cliff\Desktop\Lightswitch Training\Telerick\ScheduleViewWithViewModel\Client\Bin\Debug\RadScheduleViewLightSwitch.Client.dll' could not be found ClientGenerated


    Could you point me in the right direction.
    Thanks
    Cliff
  16. jim
    jim avatar
    1 posts
    Member since:
    Feb 2008

    Posted 02 Jan 2012 Link to this post

    Thanks for the great examples.

    What do i need to do to get recurrence exceptions to be stored in the database also? I cant seem to find an example with this feature.
  17. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 03 Jan 2012 Link to this post

    Hi,

    Cliff, could you please tell me what Telerik DLLs do you reffer into your Client and ClientGenerated projects? It seems you missed one of the required DLLs for the RadScheduleView. It requeries these:
    • Telerik.Windows.Controls
    • Telerik.Windows.Controls.Input
    • Telerik.Windows.Controls.Navigation
    • Telerik.Windows.Controls.ScheduleView
    • Telerik.Windows.Data 

    Jim, exception appointments are not supported at this moment in RadScheduleView for LightSwitch.

    Kind regards,
    Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  18. Cliff McManus
    Cliff McManus avatar
    32 posts
    Member since:
    Mar 2011

    Posted 03 Jan 2012 Link to this post

    Excellent example. Thanks for te quick response this solved my problem.
    Cheers Cliff
  19. Supreet
    Supreet avatar
    19 posts
    Member since:
    Mar 2011

    Posted 01 Mar 2012 Link to this post

    Hello Telerik,
       Can you please show us a small demo on how to use Context Menu with RadScheduleView for lightswitch to create menus as shown in the attached screen shot.

    This context menu should appear when right clicked on an appointment in Schedule View..

    Any help would really be appreciated.
    Thanks 
    Supreet
  20. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 05 Mar 2012 Link to this post

    Hello,

    You can find an example with RadScheduleView and RadContextMenu with the described functionality attached.

    Greetings,
    Ivo
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  21. Swapnil
    Swapnil avatar
    1 posts
    Member since:
    Jul 2013

    Posted 11 Jul 2013 Link to this post

    Is there any way to restrict the appointment from getting highlighted when a user clicks on any appointment ?
    I mean I have certain scenarios in which nothing should happen when a user clicks on the appointment. Can I make use of a Boolean converter in order to prevent this selection ?
  22. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 15 Jul 2013 Link to this post

    Hi,

    In order to achieve similar behavior you will have to create a new class derived from AppointmentSelectionBehavior and override the GetSelectedAppointments method. If you override and return Enumerable.Empty<IOccurrence>() into this method you would disable the selection of RadScheduleView.

    public class CustomAppointmentSelectionBehavior : AppointmentSelectionBehavior
    {
        protected override System.Collections.Generic.IEnumerable<IOccurrence> GetSelectedAppointments(AppointmentSelectionState state, IOccurrence target)
        {
            return Enumerable.Empty<IOccurrence>();
        }
    }

    <telerik:RadScheduleView Appointments="{Binding Appointments}">
        <telerik:RadScheduleView.ViewDefinitions>
            <telerik:DayViewDefinition />
            <telerik:TimelineViewDefinition />
        </telerik:RadScheduleView.ViewDefinitions>
         
        <telerik:RadScheduleView.AppointmentSelectionBehavior>
            <local:CustomAppointmentSelectionBehavior />
        </telerik:RadScheduleView.AppointmentSelectionBehavior>
    </telerik:RadScheduleView>


    Regards,
    Ivo
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
DevCraft banner