locked
Getting start date and end date on a datetime picker RRS feed

  • Question

  • I am a bit confused on how I can capture the user's input of a date range with in the datetime picker control. I know there are properties selectionstart and selection end but how would I differentiate between the user's start and end date? And how would the user even select the days between a start and end date? When I use date time picker it only allows me to select one value at a time. 

    I need this information to pull records in an sql database that are between two dates. 

    Thursday, August 30, 2012 8:13 PM

Answers

  • In my case I used 2 date time pickers. letting the user select 2 different dates in a single picker of calendar control can be a bit tricky, specially with not-so-technical users.
    • Proposed as answer by Jason Dot Wang Tuesday, September 4, 2012 2:40 AM
    • Marked as answer by MARV102 Thursday, September 6, 2012 7:35 PM
    Thursday, August 30, 2012 10:27 PM
  • I agree with Bhaskar. DatePicker is wrapping a Calendar object. But there is no such thing like a "SelectedDates" property, since DatePicker allows only for selecting one single date.

    So, using two different DatePicker objects seems to be the only practicable option.

    Kind regards,

    wizend

    • Proposed as answer by Jason Dot Wang Tuesday, September 4, 2012 2:40 AM
    • Marked as answer by MARV102 Thursday, September 6, 2012 7:35 PM
    Sunday, September 2, 2012 3:29 PM
  • You can use a MonthlyCalendar and change the property CalendarDimension to 4,3 which will give you an entire year.

    jdweng

    • Proposed as answer by Jason Dot Wang Tuesday, September 4, 2012 2:40 AM
    • Marked as answer by MARV102 Thursday, September 6, 2012 7:35 PM
    Sunday, September 2, 2012 7:11 PM

All replies

  • In my case I used 2 date time pickers. letting the user select 2 different dates in a single picker of calendar control can be a bit tricky, specially with not-so-technical users.
    • Proposed as answer by Jason Dot Wang Tuesday, September 4, 2012 2:40 AM
    • Marked as answer by MARV102 Thursday, September 6, 2012 7:35 PM
    Thursday, August 30, 2012 10:27 PM
  • I agree with Bhaskar. DatePicker is wrapping a Calendar object. But there is no such thing like a "SelectedDates" property, since DatePicker allows only for selecting one single date.

    So, using two different DatePicker objects seems to be the only practicable option.

    Kind regards,

    wizend

    • Proposed as answer by Jason Dot Wang Tuesday, September 4, 2012 2:40 AM
    • Marked as answer by MARV102 Thursday, September 6, 2012 7:35 PM
    Sunday, September 2, 2012 3:29 PM
  • You can use a MonthlyCalendar and change the property CalendarDimension to 4,3 which will give you an entire year.

    jdweng

    • Proposed as answer by Jason Dot Wang Tuesday, September 4, 2012 2:40 AM
    • Marked as answer by MARV102 Thursday, September 6, 2012 7:35 PM
    Sunday, September 2, 2012 7:11 PM