Customize Date Field in Custom Editor

4 posts, 0 answers
  1. Shankar
    Shankar avatar
    26 posts
    Member since:
    Dec 2011

    Posted 21 Aug 2012 Link to this post

    If an attribute is of type DateTime, the default control on the right side is a Date Picker, however when I try to get the filtered expression, I get in this format: '8/21/2012 11:10:00 PM'

    Is there a way we can customize this in the following (or any other format?): 21-AUG-2012 (I also don't need the time attribute)

    Please let me know.
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 22 Aug 2012 Link to this post

    Hello,

    Have you tried to format this DateTime with standard string.Format() methods for DateTime?

    Greetings,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Shankar
    Shankar avatar
    26 posts
    Member since:
    Dec 2011

    Posted 22 Aug 2012 Link to this post

    Hello Vlad,

    Yes, we can use that for converting date into a valid format, however this happens only when we try to get the filtered expression.

    What I really want is that once a date is picked, the picked value is being displayed in a text field. This value should appear in the format I want to see. Is there a possibility for this to happen out of the box?
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 24 Aug 2012 Link to this post

    Hi,

    I am not sure what this text field is. Basically when you set the value to it, you can still format the value using string.Format(). If you bind the value, then you can apply formatting for the binding. 

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top