I'm trying to use the WebDateTimeEdit control. I have one for date and one for time. So far I've been able to make it work to force the type of value being entered. The date is entered as MM/dd/yyyy, the time is entered as HH:mm (24 hour) and this works great. The problem I'm having now is that after the data is saved I can't get it to display in the text box. I'm using the code below to try and make this work. Does anyone have any idea why this might not be working?
<igtxt:WebDateTimeEdit Width="60px" ID="enterDepartFromDate" runat="server" />
this.enterDepartFromDate.EditModeFormat = "MM/dd/yyyy";this.enterDepartFromDate.DataMode = Infragistics.WebUI.WebDataInput.DateDataMode.Text;this.enterDepartFromDate.Value = jobEntity.DepartFromTime.Value.ToString("MM/dd/yyyy");
I just tried moving the code to a separate page for testing and now have the following.
protected void Page_Load(object sender, EventArgs e){ if (!this.IsPostBack) { this.enterDepartFromDate.EditModeFormat = "MM/dd/yyyy"; this.enterDepartFromDate.DataMode = Infragistics.WebUI.WebDataInput.DateDataMode.Text; this.enterDepartFromDate.Value = "2/11/2009"; }}
This is not displaying anything in the text box on the page. I want to add that I also use this control in a grid and it works fine. It only doesn't work by it self on the page.
Hello,
Could you please provide more additional information about this line:this.enterDepartFromDate.Value = jobEntity.DepartFromTime.Value.ToString("MM/dd/yyyy");
When I set DateTime or string value works properly.
DateTime dt = new DateTime(2000, 10, 10);WebDateTimeEdit1.Value = dt;
Or with stringWebDateTimeEdit1.Value = “10/10/2000”;
Thanks.