[英]telerik:RadCalendar does not focus on set date
I'm using a RadCalendar on a WebForm. 我在WebForm上使用RadCalendar。 this is my RadCalendar:
这是我的RadCalendar:
<telerik:RadCalendar RenderMode="Lightweight" ID="RadCalendar1" Width="100%"
EnableMultiSelect="false" EnableKeyboardNavigation="true"
ShowColumnHeaders="true" ShowDayCellToolTips="true" ShowRowHeaders="true" runat="server">
<FastNavigationSettings EnableTodayButtonSelection="true">
<ShowAnimation Type="Slide" Duration="2" /></FastNavigationSettings></telerik:RadCalendar>
I want to set RadCalendar from a DataTable using c#. 我想使用c#从数据表中设置RadCalendar。 I could succeed in my purpose using following code on
Page_Load
: 我可以在
Page_Load
上使用以下代码来达到目的:
if (!IsPostBack)
{
DataTable dt = cls.PhotoFetchById(ViewState["photoId"].ToString());
if (dt.Rows.Count > 0)
{
string date = dt.Rows[0]["phDate"].ToString();
RadCalendar1.SelectedDate = DateTime.Parse(date);
}
}
The problem is RadCalander always show current month page and if the set date is no place in current month page, it's never shown on page loading. 问题是RadCalander始终显示当前月份页面,并且如果设置日期在当前月份页面中没有位置,则永远不会在页面加载中显示。
For example, if the set date is "2013-02-12" but the current date is "2018/11/23", RadCalendar always show current month page without any selected day. 例如,如果设置日期为“ 2013-02-12”,而当前日期为“ 2018/11/23”,则RadCalendar始终显示当前月份页面,而没有任何选定的日期。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.