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

change value of date time picker in data form

1 Answer 104 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
aimen
Top achievements
Rank 1
aimen asked on 25 Apr 2012, 05:36 PM
how to set the datetime picker's value to current date when u r using a datetime picker in a dataform?

default value is like 1/1/0001

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 01 May 2012, 11:52 AM
Hi aimen,

Using SelectedValue = DateTime.Now should work. I think you can find this helpful. Also you can modify the code from the article to look like this :

if (p.PropertyType == typeof(System.DateTime))
                {
                    RadDatePicker dt = new RadDatePicker();
                    dt.SelectedValue = DateTime.Now;
                    dt.Height = 38;
                    dt.Width = 180;
                    Grid.SetColumn(dt, 1);
                    Grid.SetRow(dt, count);
                    grdView.Children.Add(dt);
........

I hope this is helpful.

Kind regards,
Georgi
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
DateTimePicker
Asked by
aimen
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or