how to remove delete button on appointment

6 posts, 1 answers
  1. raj
    raj avatar
    31 posts
    Member since:
    Jul 2011

    Posted 12 Jul 2011 Link to this post

    Hi All,
    i have a requirement to hide a delete button which is on appointment, it will display only on mouse hovers on appointment.
    any body have idea to hide this button ? Please see the attached image.

    Thanks in Advance
  2. Answer
    Dani
    Admin
    Dani avatar
    848 posts

    Posted 12 Jul 2011 Link to this post

    Hello Raj,

    Since the delete button is located in the control template of the appointment item, you need to modify the vertical and the horizontal control templates of the appointment.

    Generate from Expression Blend the ControlTemplate for RadScheduleView and extract and use only the AppoinmentItemStyleSelector and its referenced resources. Find the DeleteButton in both the horizontal and vertical templates and either hide or delete it.

    I hope this helps.

    Regards,
    Dani
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. Hardik
    Hardik avatar
    61 posts
    Member since:
    Jun 2011

    Posted 13 Jul 2011 Link to this post

    Hi support,

    Related to this point only. I am using AppointmentItemContentTemplateSelector for giving different style to appointment.

    I have created different templates for the appointment. One of them is below

    <DataTemplate x:Key="FinishedRecurrentAppointmentTemplate">
                <Border x:Name="XamlBorder" Margin="-2">
                    <Grid>
                        <ToolTipService.ToolTip>
                            <StackPanel Orientation="Vertical" MaxWidth="225" MaxHeight="225">
                                <StackPanel Orientation="Horizontal" >
                                    <TextBlock Text="{Binding Start, StringFormat=\{0:HH:mm\}}" />
                                    <TextBlock Text="-" />
                                    <TextBlock Text="{Binding End, StringFormat=\{0:HH:mm\}}" />
                                </StackPanel>
                                <TextBlock Text="{Binding Subject}"  TextWrapping="Wrap" />
                            </StackPanel>
                        </ToolTipService.ToolTip>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                            <Image x:Name="Xamlrecurrence" HorizontalAlignment="Right" VerticalAlignment="Bottom"
                             Width="10" Height="12" Source="{Binding Text, Converter={StaticResource XamlImageSourceConverter}, ElementName=XamlRecurrence}" />
                        </StackPanel>

                        <TextBlock x:Name="XamlRecurrence" Text="Recurrence" Width="1000" Visibility="Collapsed" />
                        <TextBlock x:Name="XamlSubjectTextBlock" Margin="7 0 18 0"  Width="{Binding Width, ElementName=XamlBorder}"
                         VerticalAlignment="Top"  HorizontalAlignment="Left" TextTrimming="WordEllipsis"
                         Text="{Binding Subject}"
                         Foreground="Gray" TextWrapping="Wrap" />

                    </Grid>
                </Border>
            </DataTemplate>


    As shown in bold I am using Gray color for finished appointment. Now my requirement is to hide the delete button for few users. So I think i have to create one more template for that in which I will remove delete button. And fom AppointmentTemplateSelector class using select template method for some user I will use that template where no delete button.

    How can I do this? How to create  a template which don't shows delete button. Can you provide some sample example?


    Thanks
    H@rdik Pancholi


  4. Dani
    Admin
    Dani avatar
    848 posts

    Posted 13 Jul 2011 Link to this post

    Hello Hardik,

    As I see it, you wish to make changes to the control template of an appointment item, and not the content template. So what you need is an AppointmentItemStyleSelector, not an AppointmentItemContentTemplateSelector. Please, check this help article on some more useful information on the AppointmentItemStyleSelector. Just wire up some logic in the code behind that will use an additional appointment item style, when you do not need the delete button. Also, here is a live demo that demonstrates the usage of the selector.

    The way to hide the delete button is the same as described in the earlier post.

    By the way, if your goal is to prevent the user from deleting an appoitnment, you might just make it a read-only appointment. Please, check more details on read-only slots and appointments here and here.

    I hope this will be helpful.

    Kind regards,
    Dani
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  5. raj
    raj avatar
    31 posts
    Member since:
    Jul 2011

    Posted 14 Jul 2011 Link to this post

    Hi Dani,
    Thanks for your help i have got the solution by your help.
    I have another problem in the same control.
    I have to modify the style of Datepicker control which is displaying at right top corner of SchedulerView control, please see the attached image.
    I am not able to see that in Expression Blend.

    Thanks again.

  6. Dani
    Admin
    Dani avatar
    848 posts

    Posted 15 Jul 2011 Link to this post

    Hello Raj,

    Your inquiry has been replied. This thread will be closed.

    Best wishes,
    Dani
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top