Custom date format

5 posts, 0 answers
  1. Stas
    Stas avatar
    11 posts
    Member since:
    Aug 2010

    Posted 28 Oct 2010 Link to this post

    Hi,
    I'm using RadDateTimePicker with InputMode="DatePicker".
    I need to set custom date format (MMddyyyy):
    datePicker.Culture = new CultureInfo("en-US")
    {
        DateTimeFormat = new DateTimeFormatInfo
        {
            ShortDatePattern = "MMddyyyy",
        }
    };
    datePicker.DisplayFormat = DateTimePickerFormat.Short;

    But when enter something in this format (e.g. 10282010), the control doesn't treat it as a valid date.
    Is there any way how to deal with this issue?
  2. Stas
    Stas avatar
    11 posts
    Member since:
    Aug 2010

    Posted 28 Oct 2010 Link to this post

    It looks like RadDateTimePicker expects some delimeter, so the problem is solved by a special behavior that handles
    ParseDateTimeValue event and  parses input string own way. Thanks for exposing these internals.
    Standard Silverlight controls are very badly extensible. 
  3. DevCraft banner
  4. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 02 Nov 2010 Link to this post

    Hi Stas,

    We assume that there might be a certain scenarios that doesn't confirm the customer's expectation. So the purpose of the following event - "ParseDateTimeValue" is to give the ability in the user's hands to overcome a situation like yours. Sorry if this is causing you some troubles.

    Sincerely yours,
    Kaloyan
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  5. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 15 Nov 2010 Link to this post

    I'm trying to implement this feature in a Behavior but it's crashing whenever a date is selected. I'm using the DateTimePicker in DatePicker InputMode and Month DateSelectionMode and I want to customize the DateText to not show the day, just month and yera ("MM/yyyy"). ParseDateTimeValue event is never called and I'm getting a PareseException related to some missing delimeters.
  6. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 17 Nov 2010 Link to this post

    Hi Daní,

    Can you share a fragment from your behavior that is showing the exception you are getting.

    Greetings,
    Kaloyan
    the Telerik team
    See What's New in RadControls for Silverlight in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
Back to Top
DevCraft banner