change value of date time picker in data form

2 posts, 0 answers
  1. aimen
    aimen avatar
    13 posts
    Member since:
    Jul 2011

    Posted 25 Apr 2012 Link to this post

    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
  2. Georgi
    Georgi avatar
    344 posts

    Posted 01 May 2012 Link to this post

    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);

    I hope this is helpful.

    Kind regards,
    the Telerik team

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

  3. DevCraft R3 2016 release webinar banner
Back to Top