none
How Can I Set The Value Of DatePicker RRS feed

  • Question

  • I Have 3 Strings In My Program . One Is Day , Second Is Month And Third Is Year . I Want To Assign Their Values To DatePicker . How Can I Do This ? 
    Sunday, June 15, 2014 3:08 PM

Answers

  • Hi,

    Try this:

                String day="10";
                String month = "05";
                String Year = "2014";
                CultureInfo provider = CultureInfo.InvariantCulture;
                DateTime date = DateTime.ParseExact(day + month + Year, "ddMMyyyy", provider);
    
                datePicker.Value = date;

    Sunday, June 15, 2014 4:06 PM