在页脚模板中将当前日期和时间填充为默认值

时间:2014-11-18 05:11:37

标签: c# asp.net

如何使用默认值Now填充RadDateTimePicker:

<FooterTemplate>
    <telerik:RadDateTimePicker Width="150px" ID="txt_QualityInspectorDateTimeFooter" runat="server" /> 
</FooterTemplate>

2 个答案:

答案 0 :(得分:0)

检查此链接: DateTimePicker

txt_QualityInspectorDateTimeFooter.radDateTimePicker1.Value = DateTime.Now;

答案 1 :(得分:0)

我找到了正确的解决方案:

GridViewRow gridStoppageFooterRow = gvw_InspectionMainProcess.FooterRow;
RadDateTimePicker txt_LineInchargeDateTime = gridStoppageFooterRow.FindControl("txt_LineInchargeDateTimeFooter") as RadDateTimePicker;
txt_LineInchargeDateTime.SelectedDate = DateTime.Now;