This is a migrated thread and some comments may be shown as answers.

RadDatePicker without time

5 Answers 629 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Rafael
Top achievements
Rank 1
Rafael asked on 29 Aug 2012, 11:31 PM
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" />
                        </telerik:RadDatePicker>

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

Thank you!

5 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 03 Sep 2012, 02:27 PM
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,
Eyup
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.
0
Rafael
Top achievements
Rank 1
answered on 03 Sep 2012, 03:49 PM

Eyup,

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:
03/09/2012

0
Shinu
Top achievements
Rank 2
answered on 04 Sep 2012, 08:01 AM
Hi,

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

Thanks,
Shinu.
0
Irfan Ali
Top achievements
Rank 1
answered on 18 Jan 2016, 05:27 PM
your solution working we want to get date only but RadDatePicker returning date and time though date as you suggested.
0
Eyup
Telerik team
answered on 21 Jan 2016, 12:57 PM
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:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-editinsert-mode

Alternatively, you can try using the ExtractValues method:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/manual-crud-operations/defaultcs.aspx


Regards,
Eyup
Telerik
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
Tags
Calendar
Asked by
Rafael
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Rafael
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Irfan Ali
Top achievements
Rank 1
Share this question
or