Date time formate problem in arabic culture

4 posts, 1 answers
  1. ①Dr Mostafa
    ①Dr Mostafa avatar
    20 posts
    Member since:
    Oct 2015

    Posted 24 Dec 2017 Link to this post

    My application runs under Arabic culture. After setting IsTrackChangesEnabled to true, and user starts making changes, then saves the document. When he opens the document next time the error shown in the image below develops.

    I assume that; this occurred because, changes are tracked by date and time, and when displayed later on they must be displayed using their localization culture which is English.

    Is there a way to set culture of RadRichTextBox or the component responsible for tracking changes, or any other solution?

    Any help will be greatly appreciated....

  2. Answer
    Peshito
    Admin
    Peshito avatar
    527 posts

    Posted 26 Dec 2017 Link to this post

    Hello,

    I tried to reproduce this issue but to no avail. Could you send us the document reproducing the issue?

    Changing the culture of RadRichTextBox can be achieved as shown below:
    var culture = new CultureInfo("ar-SA") { NumberFormat = { DigitSubstitution = DigitShapes.NativeNational } };
    Thread.CurrentThread.CurrentCulture = culture;
    Thread.CurrentThread.CurrentUICulture = culture;
    Add the code above to your App.xaml.cs. To present the dates into the desired format you need to set the NumberFormat of the CultureInfo to the NativeNational DigitShape.

    Hope this helps.

    Regards,
    Peshito
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. ①Dr Mostafa
    ①Dr Mostafa avatar
    20 posts
    Member since:
    Oct 2015

    Posted 26 Dec 2017 Link to this post

    Thank you very much for your response. I will try out your solution, and I will inform you soon about the result.
  4. ①Dr Mostafa
    ①Dr Mostafa avatar
    20 posts
    Member since:
    Oct 2015

    Posted 26 Dec 2017 Link to this post

    Thank you very very much Peshito. It worked. It seamed that I missed setting DigitSubstitution of NumberFormat of the Arabic culture, as you suggested.

    I marked your response as answered.

Back to Top