Change UI of radDatetimePicker

13 posts, 1 answers
  1. Eastern
    Eastern avatar
    43 posts
    Member since:
    Sep 2010

    Posted 09 Nov 2010 Link to this post

    hello,

    i am using RadControls 2010 Q2 , and in the radDatetimePicker i am going to change the Culture property of it to the Persian Culture.
    it throws this exception :

    Specified time is not supported in this calendar. It should be between 03/21/0622 00:00:00 (Gregorian date) and 12/31/9999 23:59:59 (Gregorian date), inclusive.
    Parameter name: time


    would you please help me to find a solution for it ?
    how can i change the culture of radDatetimePacker ?
  2. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 09 Nov 2010 Link to this post

    Hello,

    Sadly at this time, the RadDateTimePicker just supports the Gregorian Calendar. I would suggest sending a support ticket for this and maybe if there will be enough requests for this they would create it in the future.

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Eastern
    Eastern avatar
    43 posts
    Member since:
    Sep 2010

    Posted 09 Nov 2010 Link to this post

    ok , thanks for your support.

    but why telerik do not design and develop a complete and all situation control !!!!
    i dont think it is that hard to make a control works with every CultureInfo object
  5. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 09 Nov 2010 Link to this post

    Hello again,

    Sorry, i think i misunderstood you just want the current culture, not the persian calendar?

    You can set the current culture of the RadDateTimePicker to persian like so:
    this.radDateTimePicker1.Culture = new System.Globalization.CultureInfo("fa-IR");

    You can also try this in the Demos applications under: Editors -> Masked Edit Box

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
  6. Eastern
    Eastern avatar
    43 posts
    Member since:
    Sep 2010

    Posted 09 Nov 2010 Link to this post

    i already did that ,
    but it throws that exception i wrote in post #1, maybe its because of min & max value of raddatetime ?
  7. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 09 Nov 2010 Link to this post

    Hello again,

    Just set the Value to DateTime.Now, it should work, or please try the following example which is working for me:
    public partial class Form1 : Form
    {
        private RadDateTimePicker radDateTimePicker1;
        public Form1()
        {
            InitializeComponent();
            this.Controls.Add(radDateTimePicker1 = new RadDateTimePicker());
            radDateTimePicker1.Dock = DockStyle.Top;
     
            radDateTimePicker1.Value = DateTime.Now;
            this.radDateTimePicker1.Culture = new System.Globalization.CultureInfo("fa-IR");
        }
    }

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
  8. Eastern
    Eastern avatar
    43 posts
    Member since:
    Sep 2010

    Posted 09 Nov 2010 Link to this post

    thanks,

    i did that but the problem not solved,
    FYI the exception occurs at this method :
       at System.Globalization.PersianCalendar.CheckTicksRange(Int64 ticks)

  9. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Nov 2010 Link to this post

    Hi Eastern, 

    I've seen others on the web with other systems have the same issue with calendars and the Persian culture. Do you need the time part of the RadDateTimePicker? If not, then you may be able to get around it by setting the time part manually. 

    Hope that helps
    Richard
  10. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 09 Nov 2010 Link to this post

    Eastern, 

    Please review this article

    Richard
  11. Eastern
    Eastern avatar
    43 posts
    Member since:
    Sep 2010

    Posted 09 Nov 2010 Link to this post

    absolutely not , i am not need the time part
    so how can i getting around it ?
  12. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 09 Nov 2010 Link to this post

    Hello again,

    Ok, let me make myself clear, the RadDateTimePicker does not suppor the persian Calendar, but it does support displaying data (formatting dates) in the persian culture.

    In your case you are trying to use the persian calendar, not just the culture.

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
  13. Eastern
    Eastern avatar
    43 posts
    Member since:
    Sep 2010

    Posted 09 Nov 2010 Link to this post

    ok , thanks

    i was just seeking a workaround for it.
    i guess the problem occurs because of the MinDate of radDateTimePicker.
    i think the control try to compare datetime with MinDate property and it throws exception there
  14. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 12 Nov 2010 Link to this post

    Thank you all for writing. 

    Emanuel stated what the situation is and what you can and can not use. Additionally, Richard has provided you with a nice article where you can gain additional information. 

    In my tests no exception is being thrown when I try using Emanuel's suggestion in order to change the Culture to Persian. In case you have an issue with this, do not hesitate to open a new support ticket and send us your sample application that demonstrates the exception. This will allow us to investigate this case further.

    Sincerely yours,
    Stefan
    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
Back to Top
UI for WinForms is Visual Studio 2017 Ready