Localize watermark datetime filter

19 posts, 0 answers
  1. uku
    uku avatar
    57 posts
    Member since:
    Mar 2009

    Posted 27 Sep 2010 Link to this post

    Hello,

    how can I localize the "Enter date" watermark of the DateTimePicker in the new type aware filter.

    Thanks for your help

    Uwe
  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 30 Sep 2010 Link to this post

    Hello uku,

    You have to use the Telerik's LocalizationManager class implementation. Find our blog post showing this approach.

    Best wishes,
    Kaloyan
    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. DevCraft banner
  4. uku
    uku avatar
    57 posts
    Member since:
    Mar 2009

    Posted 30 Sep 2010 Link to this post

    Hello Kaloyan,

    thanks for your reply, but my problem is not the localization itself but the correct resource key of the datetimepicker watermark "Enter date" within the filter dialog. I simply don't know how the resource key should be. In the online documentation the resource key is missing http://www.telerik.com/help/silverlight/gridview-localization2.html

    Bye

    Uwe
  5. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 01 Oct 2010 Link to this post

    Hi uku,

    Sorry for the misleading. Here is the declaration of the property. The resource key is "EnterDate".

    public static readonly DependencyProperty DateTimeWatermarkContentProperty =DependencyProperty.Register("DateTimeWatermarkContent", typeof(object), typeof(RadDateTimePicker), new PropertyMetadata(LocalizationManager.GetString("EnterDate")));

    Kind regards,
    Kaloyan
    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
  6. uku
    uku avatar
    57 posts
    Member since:
    Mar 2009

    Posted 11 Oct 2010 Link to this post

    Hello Kaloyan,

    I've tried the "EnterDate" resource key but it does not seem to work. Everything is translated in the filter dialog except the "Enter date" watermark. I can't see what might be wrong. May be you have a small sample.

    Thanks for your support

    Uwe

  7. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 14 Oct 2010 Link to this post

    Hello uku,

    Would you please send us the code with whom you are trying the manual localization.

    All the best,
    Kaloyan
    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
  8. uku
    uku avatar
    57 posts
    Member since:
    Mar 2009

    Posted 14 Oct 2010 Link to this post

    Hello Kaloyan,

    this is the code to localize the grid view
    public partial class SilverlightControl1
    {
        public SilverlightControl1()
        {
            LocalizationManager.DefaultResourceManager = SLControlResource.ResourceManager;
            InitializeComponent();
        }
    }

    I've attached two images. One with the resource keys and one with the filter dialog. As you can see everything is localized within the dialog without "Enter date". Because I don't see any code issue my guess was that the resource key is wrong.

    I hope I've delivered all infos for you to see what the problem might be.

    Bye

    Uwe
  9. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 14 Oct 2010 Link to this post

    Hello uku,

    Try the code bellow. It should work if a Resources.de.resx is presented in your project and also you app must support the "de" cluture:

    <SupportedCultures>en;de;</SupportedCultures>

    LocalizationManager.Manager = new LocalizationManager()
                {
                    Culture = new System.Globalization.CultureInfo("de"),
                    ResourceManager = RadDateTimePickerLocalization.Properties.Resources.ResourceManager
                };


    Greetings,
    Kaloyan
    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
  10. Sodi We
    Sodi We avatar
    160 posts
    Member since:
    Apr 2010

    Posted 29 Oct 2010 Link to this post

    I've got the same problem.

    The resources work perfectly for the filters and other keys in the gridview. However, the DateTimeWatermarkContent (EnterDate) does not work.

    My resources are initialized as following:
    LocalizationManager.Manager = new LocalizationManager()
    {
        ResourceManager = GridViewResources.ResourceManager
    };

    The key is defined in GridViewResources.resx, so it's the default culture.

    PS: the "GridViewFilterDoesNotContain"-key is also missing in the help article.
  11. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 04 Nov 2010 Link to this post

    Hello Sodi We,

    Can you send us a project with the custom localization manager of your site. Also which version of the control are you using?

    Sincerely yours,
    Kaloyan
    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
  12. Sodi We
    Sodi We avatar
    160 posts
    Member since:
    Apr 2010

    Posted 05 Nov 2010 Link to this post

    We use version 2010.2.924.1040 (which should be the latest version).

    When I debug I can see that LocalizationManager.GetString("EnterDate") returns my correctly localized string.

    This is the exact code used in the declaration of the DateTimeWatermarkContentProperty. So, I think there is nothing wrong with the application culture, nor the resource file.
  13. Sodi We
    Sodi We avatar
    160 posts
    Member since:
    Apr 2010

    Posted 05 Nov 2010 Link to this post

    Appearantly, the localization does work from within the filters of the gridview.

    The problem is that it does not work in a RadDateTimePicker anywhere else.
  14. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 10 Nov 2010 Link to this post

    Hello Sodi We,

    Please find the attached example with a custom localization manager applied to the RadDateTimePicker control.

    All the best,
    Kaloyan
    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
  15. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 02 Apr 2012 Link to this post

    Hi,

    We have the same problem.
    But we are storing all our texts in the database so we cannot use resource files as in the example above.

    Our solution is to have a cutom LocalizationManager and override the GetStringOverride() method.
    It usually works fine, but in this case (FilteringControl in a GridView) the EnterDate key is never passed through this method.
    I guess it's because it actually resides in the DatePicker control and not in the FilteringControl?

    Is there any solution to this?
    Just clearing the watermark would be fine for us.

    Regards,
    Håkan
  16. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 06 Apr 2012 Link to this post

    Hi Håkan,

    We introduced built in localization for the RadDateTimePicker with the 2011 Q3 release of RadControls for Silverlight. I guess you use older version and that is why the EnterDate is never passed to the GetStringOverride() method into your solution. You can remove the watmerkark by editting the RadDateTimePicker's template. There you will have to find the "PART_DateTimeInput" and set WatermarkContent to an empty string.

    Greetings, Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  17. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 10 Apr 2012 Link to this post

    Hi Ivo.

    Actually I'm using the latest official release 2012 Q1.

    Thought it had to do with the DateTimePicker beeing inside the FilteringControl, but now I tried to put a RadDateTimePicker by itself with no luck either. The RadDatePicker didn't work either.

    Regards,
    Håkan
  18. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 10 Apr 2012 Link to this post

    Hello Håkan,

    This sounds really strange. I tested it into a sample project with a custom LocalizationManager and the GetStringOverride was called with parameter "EnterDate". You can find my project attached. Have I missed anything?

    Regards, Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  19. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 11 Apr 2012 Link to this post

    Hi Ivo.

    This is indeed very strange.
    I tried your project and also added a GridView with a Date as in my project and it works.

    If I compare the keys that are passed through the GetStringOverride in your project compared to mine,
    the following keys are not passed in my project:
    EnterDate
    Error
    SetToday
    Close

    Could there be some version mismatch after all?
    All my Telerik referenced dll's are in version 2012.1.215.1040.
    I have a Silverlight 4 project.

    Regards,
    Håkan

  20. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 11 Apr 2012 Link to this post

    Hi,

    I retested this with the version you mentioned and Silverlight 4. Everything worked as expected. Could you please send us a sample project reproducing this so we could investigate it further? In order to send us a project you will have to open a new support ticket.

    Greetings, Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner