Click to Rate and Give Feedback
Community Content
In this section
Statistics Annotations (3)
Collapse All/Expand All Collapse All
This page is specific to
The 2007 product release

Other versions are also available for the following:
DateTimeControl Class (Microsoft.SharePoint.WebControls)
Represents a DateTime control.

Namespace: Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Visual Basic (Declaration)
<DefaultPropertyAttribute("Text")> _
<ToolboxDataAttribute("<{0}:DateTimeControl runat=server></{0}:DateTimeControl>")> _
<DesignerAttribute(GetType(SPControlDesigner))> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel:=True)> _
Public Class DateTimeControl
    Inherits SPCompositeControl
    Implements IValidator, IPostBackDataHandler, IDesignerEventAccessor
Visual Basic (Usage)
Dim instance As DateTimeControl
C#
[DefaultPropertyAttribute("Text")] 
[ToolboxDataAttribute("<{0}:DateTimeControl runat=server></{0}:DateTimeControl>")] 
[DesignerAttribute(typeof(SPControlDesigner))] 
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel=true)] 
public class DateTimeControl : SPCompositeControl, IValidator, IPostBackDataHandler, IDesignerEventAccessor
System.Object
   System.Web.UI.Control
     Microsoft.SharePoint.WebControls.SPCompositeControl
      Microsoft.SharePoint.WebControls.DateTimeControl
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Bug: DateTimeControl loses state of Hour during postback      Louis de Klerk   |   Edit   |   Show History

This DateTimeControl loses state during postback, specifically of the Hour.

More specifically, if this DateTimeControl control is used in a WebPart, and a different WebPart on the same page causes a postback, this DateTimeControl loses the previously chosen hour. (The date and minute are correctly kept, only the hour is lost, and defaulted to 12:00am)

Lets hope a fix for this is forthcoming.

Bug: Min & Max Date functionality      Andrew N Jacks   |   Edit   |   Show History

Setting the Minimum and Maximum date ranges does not always provide the expected results.

Setting a date to have a minimum date restricts a date being selected in the calandar view, but allows the user to actually enter a prior date.

Setting a maximum date does not appear to provide any restrictions at all.

The calendar view's default date cannot be set and defaults to Today. This is annoying when the minimum date has been set to the future.

It would be great if this control could be reviewed and changed to work as expected so that the end user can have a more pleasurable experience.

Disabling the text box associated with the DateTimeControl from code      Peter Holpar   |   Edit   |   Show History
There is no out of the box support to hide the text box of this control through the UI or using simple control properties. If you need to do that, look a possible workaround here:
http://pholpar.wordpress.com/2009/12/03/disabling-the-text-box-associated-with-the-datetimecontrol-from-code/
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker