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

how to remove delete button on appointment

5 Answers 225 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
raj
Top achievements
Rank 1
raj asked on 12 Jul 2011, 07:43 AM
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

5 Answers, 1 is accepted

Sort by
0
Accepted
Dani
Telerik team
answered on 12 Jul 2011, 02:44 PM
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!

0
Hardik
Top achievements
Rank 1
answered on 13 Jul 2011, 07:18 AM
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


0
Dani
Telerik team
answered on 13 Jul 2011, 09:27 AM
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!

0
raj
Top achievements
Rank 1
answered on 14 Jul 2011, 09:32 AM
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.

0
Dani
Telerik team
answered on 15 Jul 2011, 09:52 AM
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!

Tags
ScheduleView
Asked by
raj
Top achievements
Rank 1
Answers by
Dani
Telerik team
Hardik
Top achievements
Rank 1
raj
Top achievements
Rank 1
Share this question
or