This is a migrated thread and some comments may be shown as answers.

Change UI of radDatetimePicker

12 Answers 157 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Eastern
Top achievements
Rank 1
Eastern asked on 09 Nov 2010, 07:37 AM
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 ?

12 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 09 Nov 2010, 09:46 AM
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
0
Eastern
Top achievements
Rank 1
answered on 09 Nov 2010, 01:46 PM
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
0
Emanuel Varga
Top achievements
Rank 1
answered on 09 Nov 2010, 01:51 PM
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
0
Eastern
Top achievements
Rank 1
answered on 09 Nov 2010, 02:51 PM
i already did that ,
but it throws that exception i wrote in post #1, maybe its because of min & max value of raddatetime ?
0
Emanuel Varga
Top achievements
Rank 1
answered on 09 Nov 2010, 03:12 PM
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
0
Eastern
Top achievements
Rank 1
answered on 09 Nov 2010, 03:18 PM
thanks,

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

0
Richard Slade
Top achievements
Rank 2
answered on 09 Nov 2010, 03:35 PM
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
0
Richard Slade
Top achievements
Rank 2
answered on 09 Nov 2010, 03:37 PM
Eastern, 

Please review this article

Richard
0
Eastern
Top achievements
Rank 1
answered on 09 Nov 2010, 03:42 PM
absolutely not , i am not need the time part
so how can i getting around it ?
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 09 Nov 2010, 03:43 PM
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
0
Eastern
Top achievements
Rank 1
answered on 09 Nov 2010, 03:55 PM
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
0
Stefan
Telerik team
answered on 12 Nov 2010, 10:21 AM
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
Tags
DateTimePicker
Asked by
Eastern
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Eastern
Top achievements
Rank 1
Richard Slade
Top achievements
Rank 2
Stefan
Telerik team
Share this question
or