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

Localize watermark datetime filter

18 Answers 210 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
uku
Top achievements
Rank 1
uku asked on 27 Sep 2010, 10:13 PM
Hello,

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

Thanks for your help

Uwe

18 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 30 Sep 2010, 02:50 PM
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
0
uku
Top achievements
Rank 1
answered on 30 Sep 2010, 07:06 PM
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
0
Kaloyan
Telerik team
answered on 01 Oct 2010, 09:33 AM
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
0
uku
Top achievements
Rank 1
answered on 11 Oct 2010, 04:56 PM
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

0
Kaloyan
Telerik team
answered on 14 Oct 2010, 08:35 AM
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
0
uku
Top achievements
Rank 1
answered on 14 Oct 2010, 10:03 AM
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
0
Kaloyan
Telerik team
answered on 14 Oct 2010, 12:56 PM
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
0
Licenses
Top achievements
Rank 1
answered on 29 Oct 2010, 10:40 AM
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.
0
Kaloyan
Telerik team
answered on 04 Nov 2010, 04:37 PM
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
0
Licenses
Top achievements
Rank 1
answered on 05 Nov 2010, 03:27 PM
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.
0
Licenses
Top achievements
Rank 1
answered on 05 Nov 2010, 03:30 PM
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.
0
Kaloyan
Telerik team
answered on 10 Nov 2010, 01:37 PM
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
0
Håkan
Top achievements
Rank 1
answered on 02 Apr 2012, 10:29 AM
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
0
Ivo
Telerik team
answered on 06 Apr 2012, 10:00 AM
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 >>

0
Håkan
Top achievements
Rank 1
answered on 10 Apr 2012, 10:51 AM
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
0
Ivo
Telerik team
answered on 10 Apr 2012, 01:17 PM
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 >>

0
Håkan
Top achievements
Rank 1
answered on 11 Apr 2012, 07:26 AM
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

0
Ivo
Telerik team
answered on 11 Apr 2012, 08:03 AM
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 >>

Tags
GridView
Asked by
uku
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
uku
Top achievements
Rank 1
Licenses
Top achievements
Rank 1
Håkan
Top achievements
Rank 1
Ivo
Telerik team
Share this question
or