RadDatePicker without time

6 posts, 0 answers
  1. Rafael
    Rafael avatar
    3 posts
    Member since:
    Oct 2010

    Posted 29 Aug 2012 Link to this post

    When I use RadDatePicker and update the item, the label show the result 29/08/2012 00:00:00.

                            <telerik:RadDatePicker ID="RadDatePicker1" runat="server" DbSelectedDate='<%# Bind("rEstimatedDelivery") %>' >
                                <DateInput runat="server" DateFormat="dd/MM/yyyy" DisplayDateFormat="dd/MM/yyyy" />
                                <Calendar runat="server" ViewSelectorText="dd/MM/yyyy" TitleFormat="dd/MM/yyyy" />

    How can I update only 29/08/2012, without 00:00:00 ?

    Thank you!
  2. Eyup
    Eyup avatar
    3320 posts

    Posted 03 Sep 2012 Link to this post

    Hello Rafael,

    Could you please elaborate some more on your specific scenario? Exactly what do you mean by "update the item"?

    I have created a sample RadGrid web site to test the described appearance. On my side everything works as expected. Could you please check out the attached application and try to distinguish the crucial differences between our projects?

    All the best,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Rafael
    Rafael avatar
    3 posts
    Member since:
    Oct 2010

    Posted 03 Sep 2012 Link to this post


    I want to save only the date on database, but the RadDatePicker saved date and time. The RadDateTimePicker need to save date and time, RadDatePicker need to save only date, right? But RadDatePicker is working same RadDateTimePicker. What I need to do to solve the problem?

    Result when save RadDatePicker:
    03/09/2012 00:00:00

    But I want to save:

  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 Sep 2012 Link to this post


    Try saving the date as shown below.
    string s=RadDateTimePicker1.SelectedDate.Value.ToShortDateString();

  5. Irfan Ali
    Irfan Ali avatar
    1 posts
    Member since:
    Jan 2016

    Posted 18 Jan 2016 in reply to Shinu Link to this post

    Shinu your solution not working we want to get date only but RadDatePicker returning date and time though formatted date as you suggested.
  6. Eyup
    Eyup avatar
    3320 posts

    Posted 21 Jan 2016 Link to this post

    Hello Irfan,

    You can access the control using ItemCommand/UpdateCommand/InsertCommand methods provided by RadGrid and modify the value before passing it to the database:

    Alternatively, you can try using the ExtractValues method:

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top