我需要在ajaxcontroltoolkit中将未来的日期(今天的日期之后的日期)变灰 [英] I need to grey out the future dates (dates beyond today's date) in ajaxcontroltoolkit
问题描述
我需要在ajaxcontroltoolkit calendarextender控件中显示未来日期(超出今天日期的日期)。我怎样才能做到这一点?我已经能够做到这一点,用户无法从calendarextender控件中选择未来的日期,但我希望将未来的日期变为灰色,这些日期是不可选择的视觉线索。
不希望禁用日期为剪切,我需要灰色(禁用)未来日期
提前谢谢。
I need to grey out the future dates (dates beyond today's date) in ajaxcontroltoolkit calendarextender control. How can I achieve this? I have been able to do as much that the user is not able to select future dates from the calendarextender control but I wish to grey out the future dates for visual clue that these dates are not selectable.
Do not want disable date as cut, I need to gray(disable) future dates
Thanks in advance.
推荐答案
试试这个
Try this
CalendarExtender1.EndDate = DateTime.Now;
来改变你可以改变风格的风格
ajax__calendar_invalid css中的类
to change the style you can change style in
ajax__calendar_invalid class in the css
覆盖日渲染功能。
Override the day render function.
Private Sub Calendar1_DayRender(sender As Object, e As DayRenderEventArgs)
If e.Day.Date > EndOfDateRange Then
e.Cell.BackColor = System.Drawing.Color.LightGray
e.Day.IsSelectable = False
End If
End Sub
这篇关于我需要在ajaxcontroltoolkit中将未来的日期(今天的日期之后的日期)变灰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!