在 Telerik RadScheduler 中设置所选约会/项目的样式
我有一个显示事件(或约会)的 Telerik RadScheduler。
我正在尝试使用较粗的红色边框来设计所选约会的样式。
我找到了设置约会项目样式的页面在 Telerik 网站上,但它与 Silverlight 相关,并且它提到的属性似乎在 WPF 版本中不存在。
我希望我能够在 ViewModel 中设置一个 bool
来描述是否选择了该项目,然后创建一个数据触发样式,这将起作用,但我更愿意如果可能的话直接使用 XAML - 并且鉴于这似乎是在 Silverlight 中实现的,我希望它也应该存在于 WPF 中。
我想要这样的东西,如果存在的话
<telerik:RadScheduler Name="radScheduler"
DataContext="{Binding}"
SelectedAppointmentStyle="{StaticResource aStyle}"
有人这样做过,或者可以提供一些指示吗?
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 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
RadScheduler 上似乎没有任何属性可以满足此类要求。
我的解决方法是实现一个“IsSelected”属性,该属性在触发命令时设置;然后将样式绑定到该属性。
缺点是我对约会是否被“选择”并没有真正的约束力,但它运作得很好。
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.
这是事后不久的事,但是,有一些有关设计约会样式的信息:
http://www.telerik.com /help/aspnet-ajax/scheduler-set- different-styles-to-appointments.html
它涵盖了几种不同的方法,利用代码隐藏和 CSS。
至于选择问题,您可以使用 OnAppointmentClick 或 OnClientAppointmentClick 方法并在其中设置样式。它并不像您正在寻找的那么简洁,但是可以完成工作。
另外,请查看:
http://blogs.telerik.com/aspnetmvcteam/posts/09-04-08/easy-appointment-styling-with-radscheduler-for-asp-net-ajax.aspx
您可能有可能您分配的“选定”资源,它会采用样式。
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.