Hi,
I have a webdatepicker in my web form. On pick of any date in the calendar the default time comes as 12:00 am. Is there a way when pick on date the current system time should be picked. I need the DateTime value from txtDate.Date parameter.
<ig:WebDatePicker ID="txtDate" runat="server" DisplayModeFormat="MM/dd/yyyy h :mm">
<Buttons SpinButtonsDisplay="OnRight"></Buttons></ig:WebDatePicker>
Thanks
Hello ssvan,
You can handle ValueChanged event:
<ig:WebDatePicker ID="txtDate" runat="server" DisplayModeFormat="MM/dd/yyyy h:mm"
EditModeFormat="MM/dd/yyyy h:mm" onvaluechanged="txtDate_ValueChanged">
<AutoPostBackFlags ValueChanged="On" />
<Buttons SpinButtonsDisplay="OnRight">
</Buttons>
</ig:WebDatePicker>
protected void txtDate_ValueChanged(object sender, Infragistics.Web.UI.EditorControls.TextEditorValueChangedEventArgs e)
{
DateTime currentValue = DateTime.Now;
DateTime newValue = (DateTime)e.NewValue;
txtDate.Value = new DateTime(newValue.Year,newValue.Month, newValue.Day, currentValue.Hour, currentValue.Minute,currentValue.Second);
}
Hope this helps.
Hi
When i use the webdatepicker as shown below with tt i.e. AM / PM too on page load the calender doesn't show up when clicked on the dropdown icon but if a postback or any ajax postback happens it starts working so is there anything i need to initialize? please let me know
<ig:WebDatePicker ID="tbEndTime" runat="server" DisplayModeFormat="MM/dd/yyyy h:mm tt"
EditModeFormat="MM/dd/yyyy h:mm tt" Width="200px">
<Buttons SpinButtonsDisplay="OnRight"></Buttons>