.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

spuc:DateTimeControl ParameterBinding

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :SharePoint

I'm using a spuc:DateTimeControl on a custom page built with SharePoint Designer 2007 and I'm having trouble passing the values selected to a DVWP on the page.  I think I have something wrong in the Parameter Binding.  Any ideas about what I might be doing wrong?

This is the control on the page as it was added by default:

<spuc:DateTimeControl runat="server" id="dtCreatedDate">
     <asp:TextBox runat="server" MaxLength="45" CssClass="ms-input" ID="DateTimeControl1Date">
     <asp:DropDownList runat="server" ID="DateTimeControl1DateHours" dir="ltr">
         <asp:ListItem Selected="True" Value="12 AM">12 AM
         <asp:ListItem Value="1 AM">1 AM
         <asp:ListItem Value="2 AM">2 AM

View Complete Post

More Related Resource Links

JavaScript to get SharePoint DateTimeControl SelectedDate value?

Can anyone explain or give an example of how to get the SelectedDate value of a SharePoint datetimecontrol using JavaScript?  I have two of the datetimecontrols on a page and would like to capture the values and use them in query string variables when a button is clicked, but I cannot figure out the correct JavaScript syntax to get it.  The controls are set to DateOnly = True, so I have tried to reference them by the top-level ID (ie. DateTimeControl1) and by the ID of the textbox used for the date portion (ie. DateTimeControl1Date), but so far neither works.  Thanks in advance!Chanda

binding datetimecontrol,dropdown,textbox inside gridview and update each gridviewrow

i have a web part with datetimecontrol(sharepoint) inside a  gridview. when the page loads this this gridview will be loaded with dtc control and the selecteddate would be one of the columns in the splist.also gridview contaisn dropdowns, textboxes, when an update button cliked inside grid, i need to save the info in the splist.  currently i am not getting the value  bound with dtc control. i am getting blank date inside dtc. though in the  rowdatabound event i amcapturing the values due to some reason i am not able to view the value in the DTCcontrol. can anybody give me help me how to achieve this? any  help links/ sample code.. appreciate the help                         

Sharepoint DateTimeControl in Firefox shows additional "true" text

Hello, we have problem with sharepoint DateTimeControl in firefox. Basically it works almost perfect, but there is one issue: after selecting date in popup calendar, additional "true" text appears below the control. You can see it here . We need to click one more time the calendar icon to make it disappear. How to solve this problem?

Unable to add Sharepoint DateTimeControl



Im trying to create a webpart with a date time control but whenever i drag the datetimecontrol under sharepoint category my designer throws an error saying 'object reference not set to an instance of type'. Can someone let me know why this happening.


disable Key press on SharePoint:DateTimeControl


Hello ,

- I have created a custom web part .

- Then I used "SharePoint:DateTimeControl" in this webpart and it is working fine .

- I need to disable on key press on this control . I want the user to press on button only to selec the date . And dont write anything.

how Can I do this ?



Cannot set value to DateTimeControl...


Hi there,


I have a DateTime Control in a webpart to enable a user to select a date.


          _startDateControl = new DateTimeControl();
          _startDateControl.EnableViewState = false;
          _startDateControl.DateOnly = true;
          _startDateControl.ID = "StartDateControl";
This adds the value to the page and seems to function as required.  I am then saving the value as follows.

          DateTime RevisedDate = _revisedDueDate.SelectedDate;
          projectStatusUpdateItem["RevisedDueDate"] = RevisedDate;

This also works as expected and the value is added to the SharePoint List.


The Problem i am having is when i am trying to get the DateTimeControl back to the value of the list item that i just added (i.e for editing).

I have tried the following code.




SP Designer Dataview Filtered by Parameter Using DateTimeControl



I have created a dataview in SP Designer 2007. The dataview is driven by a date filter (only show data up to the date selected by the user) which uses a parameter. The parameter is getting it's value from the DateTimeControl. Everything works fine except in order for this to work I have to use the following format (2011-05-19) for the DateTimeControl because SharePoint stores it's dates in ISO format. I have tried converting the format using a calculated column on the list, but that will only return the format (5/19/2011) as a text value which I can't filter on.

Does anyone know of a way to use the 5/19/2011 format in the DateTimeControl and still get the date filter to work?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend