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

本文关键字:默认值 当前日期 时间 填充 | 更新日期: 2023-09-27 18:30:40

如何在 RadDateTimePicker 中填充默认值 Now 如下:

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

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

检查此链接:日期时间选取器

txt_QualityInspectorDateTimeFooter.radDateTimePicker1.Value = DateTime.Now;

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

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