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

Localize this control

11 Answers 165 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Piet van Bruggen
Top achievements
Rank 1
Piet van Bruggen asked on 17 May 2011, 11:39 AM
Hi,

I'm in the need of localizing the tooltips for the dataform but cannot find the resourcekeys that are needed for this purpose.
(Or maybe i'm completely looking for the wrong solution...)

Can you provide me with those keys?

Thanks upfront!

Regards,

Piet

11 Answers, 1 is accepted

Sort by
0
Accepted
Pavel Pavlov
Telerik team
answered on 19 May 2011, 01:47 PM
Hello Piet van Bruggen,

Here are the keys used in tooltips:

DataForm_MoveCurrentToFirst
DataForm_MoveCurrentToPrevious
DataForm_MoveCurrentToNext
DataForm_MoveCurrentToLast
DataForm_AddNew
DataForm_BeginEdit
DataForm_Delete

In case you need further assistance in localizing RadDataForm , do not hesitate to contact me .

All the best,
Pavel Pavlov
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
Ben Jones
Top achievements
Rank 1
answered on 24 Jan 2012, 10:28 AM
Hi Pavel,

The Localization page for this control is missing. I need to localize the commit and cancel buttons. Do you have the resource keys for these as well?

Kind Regards

Ben

0
Pavel Pavlov
Telerik team
answered on 24 Jan 2012, 05:40 PM
Hello Ben ,

For the commit  button the string is "Confirm" and for Cancel button - "Cancel"

*Without the DataForm prefix as these are used for other controls as well.

Thank you for pointing out the missing documentation. This will be addressed immediately.  I am updating your Telerik points.

Regards,
Pavel Pavlov
the Telerik team

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

0
Ben Jones
Top achievements
Rank 1
answered on 25 Jan 2012, 11:28 AM
Thanks Pavel, that's very useful.
I have noticed, however, some peculiar behaviour with the dataform when entering edit mode. I have had to use the following line to force the page to utilise the current thread's culture:

Language = XmlLanguage.GetLanguage(Thread.CurrentThread.CurrentCulture.Name) 

And this forces the dataform to show the right date format and currency symbols in the read template. however, as soon as I click on Edit, this seems to get wiped out and everything reverts to US format, even when I return to the read mode.

Any ideas?

Kind Regards

Ben
0
Pavel Pavlov
Telerik team
answered on 30 Jan 2012, 03:42 PM
Hi Ben ,

Can you please share some details on the way date format and currency are applied in your case . I will try to reproduce it here and it provide a fix in case this appears to be a bug.

Greetings,
Pavel Pavlov
the Telerik team

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

0
Ben Jones
Top achievements
Rank 1
answered on 30 Jan 2012, 04:24 PM
Hi Pavel,

I am unable to replicate the exact behaviour in the sense that on initial load in my project, the dataform does adhere to the current ui culture as set by the following code in the MainPage.xaml.cs:

 Thread.CurrentThread.CurrentCulture = new CultureInfo("de");

 Thread.CurrentThread.CurrentUICulture = new CultureInfo("de");


And by using the following line to force the xaml page to use the necessary settings:

Language = XmlLanguage.GetLanguage(Thread.CurrentThread.CurrentCulture.Name);

I am also setting the necessary Resource Manager:

LocalizationManager.Manager = new LocalizationManager

{

    ResourceManager = Strings.ResourceManager

};


However, whilst this works for the one project, I cannot replicate it in the smaller test solution where the data is shown in US format no matter what I do.

In the original project, I get the correct format initially but this defaults to US as soon as I click edit. I have noticed that if I use the DateField control, proper format is shown, it i only when I I use the standard datafield:

<telerik:RadDataForm
    x:Name="entityForm"
    CurrentItem="{Binding CurrentEntity}" 
    ItemsSource="{Binding ItemCollection}"
    CommandButtonsVisibility="Edit,Delete,Commit,Cancel"
    AutoGenerateFields="False">
  <telerik:RadDataForm.ReadOnlyTemplate>
      <DataTemplate>
          <StackPanel>
            <telerik:DataFormDataField DataMemberBinding="{Binding StartDate, Mode=TwoWay}" Label="{Binding Source={StaticResource StringResources}, Path=StringsResources.Property1}" IsReadOnly="True" />
            <!-- Display only US format -->
            
<telerik:DataFormDateField DataMemberBinding="{Binding EndDate, StringFormat='\{0:d\}', Mode=TwoWay}" Label="{Binding Source={StaticResource StringResources}, Path=StringsResources.Property2}" IsReadOnly="True" />
            <!-- US Decimal point shown -->
            
<telerik:DataFormDataField DataMemberBinding="{Binding VAT, StringFormat='\{0:F2\}', Mode=TwoWay}" Label="{Binding Source={StaticResource StringResources}, Path=StringsResources.Property3}" IsReadOnly="True" />
            <!- USD sign and decimal point shown -->
            <telerik:DataFormDataField DataMemberBinding="{Binding Price, StringFormat='\{0:c\}', Mode=TwoWay}" Label="{Binding Source={StaticResource StringResources}, Path=StringsResources.Property4}" IsReadOnly="True" />
          </StackPanel>
      </DataTemplate>
  </telerik:RadDataForm.ReadOnlyTemplate>
  <telerik:RadDataForm.EditTemplate>
      <DataTemplate>
         <StackPanel>
          <telerik:DataFormDateField DataMemberBinding="{Binding StartDate, StringFormat='\{0:d\}', Mode=TwoWay}" Label="{Binding Source={StaticResource StringResources}, Path=StringsResources.Property1}"/>
          <telerik:DataFormDateField DataMemberBinding="{Binding EndDate, StringFormat='\{0:d\}', Mode=TwoWay}" Label="{Binding Source={StaticResource StringResources}, Path=StringsResources.Property2}" />
          <telerik:DataFormDataField DataMemberBinding="{Binding VAT,StringFormat='\{0:F2\}',  Mode=TwoWay}" Label="{Binding Source={StaticResource StringResources}, Path=StringsResources.Property3}" />
          <telerik:DataFormDataField DataMemberBinding="{Binding Price, StringFormat='\{0:c\}', Mode=TwoWay}" Label="{Binding Source={StaticResource StringResources}, Path=StringsResources.Property4}" />
         </StackPanel>
      </DataTemplate>
  </telerik:RadDataForm.EditTemplate>
</telerik:RadDataForm>

Any pointers would be much appreciated.

Kind Regards

Ben

0
Pavel Pavlov
Telerik team
answered on 02 Feb 2012, 02:44 PM
Hi Ben ,

Unfortunately I did not manage to reproduce it here . I am afraid I do not know what may be causing this. I am always available and will be glad to debug it in case we could have a repro .

Kind regards,
Pavel Pavlov
the Telerik team

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

0
Ben Jones
Top achievements
Rank 1
answered on 03 Feb 2012, 10:17 AM
Hi Pavel,

Thanks for looking into this. Perhaps you can confirm a couple of things regarding expected behaviour?

1. Using the the DataFormDataField control, you would expect any StringFormat such as {0:c}, {0:d}, {0:F2} etc to adhere to the Current UICulture if set in either the App.xaml.cs or MainPage.xaml.cs (i.e. Thread.Currentthread.CurrentUICulture = new CultureInfo("de");)

2. Within the Validation Summary, the Message Header of a ValidationSummaryItem *cannot* be changed - it appears to always be the name of the Property (whereas the Label or ErrorMessage can be controlled using the Display and Requried DataAnnotation attribues)

Kind Regards

Ben
0
Pavel Pavlov
Telerik team
answered on 08 Feb 2012, 02:01 PM
Hello Ben,


1. Using the the DataFormDataField control, you would expect any StringFormat such as {0:c}, {0:d}, {0:F2} etc to adhere to the Current UICulture if set in either the App.xaml.cs or MainPage.xaml.cs (i.e. Thread.Currentthread.CurrentUICulture = new CultureInfo("de");)

RadDataForm would do nothing different than the standard MS controls. It relies on bindings and does not do any special handling for the current culture.  In other words it will show exactly the same result as would a stand alone TextBlock with format string in the binding.
In other words :
<telerik:DataFormDataField DataMemberBinding="{Binding Price,StringFormat=\{0:C2\}}"/>
and  a standalone text box(w/o a DataForm)  like :  
<TextBlock Text="{Binding Price,StringFormat=\{0:C2\}}" />
Are expected to show exactly the same result.


2. Within the Validation Summary, the Message Header of a ValidationSummaryItem *cannot* be changed - it appears to always be the name of the Property (whereas the Label or ErrorMessage can be controlled using the Display and Requried DataAnnotation attribues)

With the current version the "Header" is taken form the field label . Whenever there is no field it falls back to the Path of the Binding.


Greetings,
Pavel Pavlov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Ben Jones
Top achievements
Rank 1
answered on 16 Feb 2012, 01:55 PM
Hi Pavel,

Thanks for clarifying these points, however, I can consistently reproduce contradictory results, even without setting the Current UI Culture, as you will see with the attached images. I have declared the following in the readonly template of a dataform:

<TextBlock Text="{Binding StartDate, StringFormat=\{0:d\}}" />       
<TextBlock Text="{Binding Price, StringFormat=\{0:F2\}}" />       
<TextBlock Text="{Binding VAT, StringFormat=\{0:c\}}" />
<telerik:DataFormDateField DataMemberBinding="{Binding StartDate, StringFormat='\{0:d\}', Mode=TwoWay}" Label="{Binding Source={StaticResource StringResources}, Path=StringsResources.Property1}" IsReadOnly="True" />       
<telerik:DataFormDataField DataMemberBinding="{Binding EndDate, StringFormat='\{0:d\}', Mode=TwoWay}" Label="{Binding Source={StaticResource StringResources}, Path=StringsResources.Property2}" IsReadOnly="True" />       
<telerik:DataFormDataField DataMemberBinding="{Binding VAT, StringFormat='\{0:F2\}', Mode=TwoWay}" Label="{Binding Source={StaticResource StringResources}, Path=StringsResources.Property3}" IsReadOnly="True" />
<telerik:DataFormDataField DataMemberBinding="{Binding Price, StringFormat='\{0:c\}', Mode=TwoWay}" Label="{Binding Source={StaticResource StringResources}, Path=StringsResources.Property4}" IsReadOnly="True" />
The captured image shows that the textblocks do indeeed, as you suggest,
conform to my current ui culture (en-GB).
However the DataFormDataFields revert to en-US format.
As for validation, the second captured image shows that when the Price fails validation,
the message header is "Price" (in red), which is the name of the property.
The Display Name of the Property is used in the description and the
dataform field label is used in the dataform but neither are used within the message header.
This again goes against what you are suggesting.
Any ideas?

Kind Regards

Ben
0
Pavel Pavlov
Telerik team
answered on 21 Feb 2012, 02:57 PM
Hello Ben,

Thanks for the  clarifications! Our QA team was able to reproduce the inconsistent behavior based on your XAML and description. I have scheduled a fix for our very next service pack - expected around 15 March. In case we have it earlier (e.g. for one of the weekly internal builds) I will drop you a line here.I am updating your Telerik points.

Kind regards,
Pavel Pavlov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
DataForm
Asked by
Piet van Bruggen
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Ben Jones
Top achievements
Rank 1
Share this question
or