Enforce Category and TimeMarker

5 posts, 0 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 16 Jul 2014 Link to this post

    Hi,

    my approach is to make sure that an appointment has a TimeMarker and a Category.

    The TimeMarker is set by code - so I want to remove the TimeMarker Combobox from the edit / create dialog.

    The Category on the other hand MUST selected in the "create dialog"...
    BUT:
    a.) The "Clear" Button in the category combobox should be removed
    --NO clear - just mandatory select
    b.) The category Combobox should be disabled if the appointment is edited (not newly created)

    How can this be done? (Pleas no "Code behind event handlers" if possible)

    Manfred
  2. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 16 Jul 2014 in reply to ManniAT Link to this post

    And the same as above I need for Resources.

    In this case I also have to disable dragging to a different group (if grouping for resource types).
  3. UI for WPF is Visual Studio 2017 Ready
  4. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 17 Jul 2014 Link to this post

    Hi Manfred,

    In order to achieve the required scenario, you will need to customize the EditAppointmentDialog through the EditAppointmentDialogStyle property of the ScheduleView.  For detailed instructions on the exact approach please check the Custom Dialogs article in our documentation.

    After retrieving the EditAppointmentDialog ControlTemplate, you can directly remove the TimeMarker ComboBox ( it is with name=PART_TimeMarkers) and set the ClearSelectionButtonVisibility property of the Categories ComboBox ( with name=PART_Categories) to "Collapsed".  Additionally, you could bind its IsEnabled property to the ViewMode property of the AppointmentDialogViewModel. ViewMode has three values according to the way the dialog is opened: Add, Create and ReadOnly. So using a converter and according to the ViewMode value, you could enable/disable the ComboBox.

    I have attached a sample example to demonstrate all above, please note that I've used Implicit Styles to set the theme as this approach makes such customizations much easier ( you do not need to copy all the referenced resources).

    The same approach can be used with the resources. Furthermore, in order to disable the the dragging of the appointments you should customize the ScheduleView DragDropBehavior as explained in this help topic.

    I hope this will be helpful.

    Regards,
    Yana
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  5. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 17 Jul 2014 Link to this post

    Hi Yana,

    I already changed the dialog (yesterday).
    By the way - I had to take one from the installation (themes) directory because neither blend nor VS2013 are able to generate (extract) the correct resources.
    The theme is "default" and also "Resources" doesn't work with the generated template.

    Anyhow - using the template from the installation directory I was able to change the dialog for my needs.

    I'll check the drag drop you suggested.

    Thank you for your excellent support.

    Manfred
  6. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 18 Jul 2014 Link to this post

    Hi Manfred,

    We are glad you have managed to achieve the desired. If you have any other questions, let us know.

    Regards,
    Kalin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top
UI for WPF is Visual Studio 2017 Ready