AppointmentStyleSelector strange behavior

2 posts, 0 answers
  1. Alexander
    Alexander avatar
    2 posts
    Member since:
    Nov 2011

    Posted 25 Nov 2011 Link to this post

    Hi 

    I'm using trial version of WPF controls (Q3 2011) and trying to implement custom appointment style as it described here
    It works well until I want to resize an appointment (please see attached screenshot). The problem is that if I use custom AppointmentStyleSelector I can't resize Appointment rectangle by dragging top or bottom edge anymore, right and left edges are highlighted for resizing instead. Usage of OrientedAppointmentItemStyleSelector as AppointmentStyleSelector leads to the same results.
    So could you please help me to figure out how to fix that issue?

    Here is a link to the demo project http://dl.dropbox.com/u/3950376/TelerikAppointmentStyle.zip

    Thanks,
    Alexander
  2. Dani
    Admin
    Dani avatar
    848 posts

    Posted 25 Nov 2011 Link to this post

    Hi Alexander,

    In your project you have created a custom AppointmentitemStyleSelector and provided custom styles for appointment items.

    The AppointmentItemStyleSelector is by default oriented, which means it is aware of appointment orientation. However, you have created your custom styles with no orientation. This means that the default orientation will be applied first, and then your custom styles will be taken into account.

    The default appointment item orientation is horizontal. And the two view definitions you use (DayView and WeekView) use actually the vertical template of the appointment item rather than the horizontal (DayView and WeekView stack appoitnments vertically, so they use vertically oriented appointments). Hence the discrepancy occurs.

     I suggest you provide both horizontal and vertical version when creating a style, if you intend to use the new style across views with different orientation. And please , remember to make your custom selector aware of orientation via the activeViewDefinition param.

    Or, as in your specific case of using only two vertically oriented views, copy the vertical control template for the appointment item in your newly created style in xaml. Leaving the style with style setters only and with no control template, will result in applying the default template.

    I hope this information will be helpful.


    Greetings,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top