Style the Selected Appointment / Item in a Telerik RadScheduler
I have a Telerik RadScheduler which displays events (or appointments).
I'm trying to style the selected appointment with a thicker red border.
I've found a page for Styling the Appointment Item on the Telerik website, but it relates to Silverlight and the properties that it mentions don't seem to exist in the WPF version.
I expect I'll be able to set up a bool
in my ViewModel that describes whether the item is selected or not, and 开发者_StackOverflow中文版then create a data-trigger style, which will work but I'd prefer to use straight XAML if possible - and seeing as this seems to be implemented in Silverlight, I expect that it should also exist in WPF as well.
I would like something like this, if it exists
<telerik:RadScheduler Name="radScheduler"
DataContext="{Binding}"
SelectedAppointmentStyle="{StaticResource aStyle}"
Has anyone done this, or can provide some pointers?
There doesn't seem to be any property on the RadScheduler which facilitates this type of requirement.
My workaround was to implement an 'IsSelected' property which gets set when a command is fired; the style is then bound to this property.
The downside is that I'm not really binding to whether the appointment is 'selected', but it works well enough.
It's a little after the fact but, there is some information on styling the appointments at: http://www.telerik.com/help/aspnet-ajax/scheduler-set-different-styles-to-appointments.html
It covers a few different methods, utilizing code-behind and CSS.
As for the selection issue, you could make use of OnAppointmentClick or OnClientAppointmentClick methods and set the style, in those. It's not as succinct as you're looking for but, would get the job done.
Also, check out: http://blogs.telerik.com/aspnetmvcteam/posts/09-04-08/easy-appointment-styling-with-radscheduler-for-asp-net-ajax.aspx
You could, potentially, have a "Selected" resource, that you assign, and it'd pick up the styling.
精彩评论