Problem to change culture to persian

10 posts, 0 answers
  1. Hamed Vaziri
    Hamed Vaziri avatar
    1 posts
    Member since:
    Feb 2010

    Posted 11 Feb 2010 Link to this post

    Hi
    i've tested out your scheduler control whether does it support persian culture or not.
    i found this link which help me very much!
    almost everyThing is ok except month view. in month view the calendar does not works correctly and also gregorian month name display in the first of the week day that i don't see it.
    in attention to that post which this schedule control does not support persian calendar, is there any way to work-around this problem ?
    thanks in advance
  2. Boyko Markov
    Admin
    Boyko Markov avatar
    610 posts

    Posted 16 Feb 2010 Link to this post

    Hi Hamed Vaziri,

    I have successfully changed the culture of RadScheduler for Winforms to Persian with the latest version of our controls:

               CultureInfo info = new CultureInfo("fa-Ir");
                this.radScheduler.Culture = info;

    Could you please try the above code and if there's a problem, please give us more detailed explanation about this issue?

    I am looking forward to your reply.

    All the best,
    Boyko Markov
    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Sahand
    Sahand avatar
    7 posts
    Member since:
    Dec 2011

    Posted 07 Dec 2011 Link to this post

    Sorry for bringing up old posts. Just found this topic while trying to integrate Persian calendar with RadScheduler.

    MSDN states about PersianCalendar:

    "Applications use a PersianCalendar object to calculate dates in the Persian calendar or convert Persian dates to and from Gregorian dates.

    Your application should not use a PersianCalendar object as the default calendar for a culture. The default calendar is specified by the CultureInfo.Calendar property and must be one of the calendars returned by the CultureInfo.OptionalCalendars property. Currently, the PersianCalendar class is not an optional calendar for any culture supported by the CultureInfo class and consequently cannot be a default calendar." (Source: http://msdn.microsoft.com/en-us/library/system.globalization.persiancalendar.aspx)

    So while there is in fact a PersianCalendar in .NET framework, it cannot be used as a default calendar for any CultureInfo. Not yet at least. As to your proposed solution, the "fa-IR" or "fa" cultures use Georgian calendar, and they also have wrong translations for week days (thanks to Microsoft).

    I think the best solution would be to use the default Georgian calendar for all the business logic and storage layer, but to change the presentation layer by converting Georgian dates to Persian using PersianCalendar class and changing every textbox or other control that is displaying dates, day of the week and month names.

  5. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 08 Dec 2011 Link to this post

    Hello Sahand,

    Thank you for sharing your findings. I believe that they will be useful to other people.

    Do not hesitate to contact us if you need any help with our products.

    Best wishes,
    Ivan Todorov
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

  6. Raminmjj
    Raminmjj avatar
    6 posts
    Member since:
    Apr 2007

    Posted 15 Feb Link to this post

    Hello.

    I create a sample application.

    http://www.mediafire.com/download/clvakkg2d6fhk3d/TelerikShamsiDate.zip

    every things is OK. but there is a problem in scheduler MontheView and datepicker data entry.

     

    scheduler MontheView problems:

    1- "this month" hyper link in navigator creates exception.

    2- View Monthly labels has just been translated into Persian,but Date values are still Gregorian.

    *there is no problem in other Views (timeline, day, week).

     

    datepicker problems:

    1- user can not type Persian date. for example I typed 1394 (persian year) but value sets 0772 !

  7. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 16 Feb Link to this post

    Hello Ramin,

    Thank you for writing.
     
    There is a known issue in the .NET Framework considering the "fa-IR" culture. Please refer to the following MSDN resource for a solution: https://code.msdn.microsoft.com/Fixing-Persian-Locale-for-6e66e044#content

    I hope this information helps. Should you have further questions I would be glad to help.
     
    Regards,
    Dess
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  8. Raminmjj
    Raminmjj avatar
    6 posts
    Member since:
    Apr 2007

    Posted 16 Feb in reply to Dess Link to this post

    Hello Dess.

    Thank you.

    RadDatepicker problem was solved, but scheduler MontheView is same as before.

    for more details, I attached some image.

  9. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 17 Feb Link to this post

    Hello Ramin,

    Thank you for writing back. 

    The provided screenshots are greatly appreciated. I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - feedback item.

    I have also updated your Telerik points.

    Currently, the possible solution that I can suggest is to use the CellFormatting event and set the correct text to be displayed: 

    private void radScheduler1_CellFormatting(object sender, SchedulerCellEventArgs e)
           {
               MonthCellElement monthCellElement = e.CellElement as MonthCellElement;
               if (monthCellElement != null)
               {
                   monthCellElement.Header.Text = monthCellElement.Date.ToString("dd", this.radScheduler1.Culture);
               }
           }

     

    I hope this information helps. If you have any additional questions, please let me know.

    Regards,
    Dess
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  10. Raminmjj
    Raminmjj avatar
    6 posts
    Member since:
    Apr 2007

    Posted 29 Oct in reply to Dess Link to this post

    Hello Dess.

    I really appreciate your help in resolving the problem.

    there is another problem in MontheView with navigation bar. if click on previous button several times, below exception will be thrown:

    "Year, Month, and Day parameters describe an un-representable DateTime."

    Thank you.
  11. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 01 Nov Link to this post

    Hello Ramin, 

    Thank you for writing back. 

    Indeed, the initial problem is fixed, but when navigating forwards / backward the mentioned exception is thrown. I have logged it in our feedback portal and I have added a vote for it on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

    I have also updated your Telerik points.

    Currently, due to the specificity of the issue, I am unable to suggest a suitable solution.

    I hope this information helps. If you have any additional questions, please let me know.


    Regards,
    Dess
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Back to Top
UI for WinForms is Visual Studio 2017 Ready