Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Globalizer.Net and Xceed DataGrid for WPF

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support
View previous topic :: View next topic  
Author Message
bvillersjr



Joined: 04 Jan 2010
Posts: 15

PostPosted: Mon Jan 04, 2010 9:06 am    Post subject: Globalizer.Net and Xceed DataGrid for WPF Reply with quote

Hello,

I am on the second day of my evaluation of Globalizer.Net and have recetly purchase one of your other products as well. I am thus far thoroughly impressed with your products. In day 1 of my globalizer.net eval, I would have completely gloablized my entire app were it not for one issue that I am hoping to resolve in this post. Excellent work! I planned months for this task.

That being said, everything in my app works properly with the globalizer excpect for the Xceed Datagrid for WPF. It never updates when the culture is changed. I think this might haver something to do with it's virtualization features that help to save memory when the columns are not visible.

Everything looks well in the code, and again, every other element of my application changes languages dynamically except for this. I also tried adding the laguage= to the datagrid declaration with no success. Here is the generated code with my language= addition:

Code:
      <xcdg:DataGridControl x:Name="dgButtons" Language="{UICulture}" Background="Transparent" CellEditorDisplayConditions="None" SelectionMode="Single" EditTriggers="None" AutoCreateColumns="True" Panel.ZIndex="1" ReadOnly="True" Visibility="Visible" Margin="0,0,0,0" ItemScrollingBehavior="Deferred" IsCopyCommandEnabled="False">
        <xcdg:DataGridControl.Columns>
          <xcdg:Column FieldName="image" Title="{Resx ResxName=SimXperienceCommander.frmMain, Key=xcdg:Column_Title1}" />
          <xcdg:Column FieldName="idButton" Title="{Resx ResxName=SimXperienceCommander.frmMain, Key=xcdg:Column_Title2}" Visible="False" IsMainColumn="False" ReadOnly="True" />
          <xcdg:Column FieldName="ButtonName" IsMainColumn="True" TextTrimming="None" TextWrapping="WrapWithOverflow" Title="{Resx ResxName=SimXperienceCommander.frmMain, Key=xcdg:Column_Title3}" />


The Xceed grid is by far the most popular for WPF apps, but I found no mention of others having issues here in the forums. A 45-day demo can be downloaded from Xceed.com.

If you think that this problem is not related to the Globalizer, please advise and I will take this matter up with Xceed support. In any case, I expect with as many deployments of this grid that exist, this will become a common question for you in the future.
_________________
Regards,


Berney Villers Jr.
SimXperience.com
http://www.SimXperience.com
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jan 04, 2010 11:39 pm    Post subject: Reply with quote

Thanks for reporting this issue. We downloaded the Xceed Datagrid evaluation and were able to replicate the problem. The issue arises because the Datagrid components (unlike most other WPF elements) don't derive from FrameworkElement. We were able to fix the Infralution.Localization.Wpf assembly to cope with this.

You can download an updated version (2.1.0) of the assembly from:

www.infralution.com/downloads/Infralution.Localization.Wpf.zip

If you remove the reference in your project to the Infralution.Localization.Wpf (version 2.0.0) assembly and then add a reference to the updated assembly this should fix the issue. We will include this fix in the release of Globalizer.NET and also update the source code on code project ( http://www.codeproject.com/KB/WPF/WPF_Resx_Localization.aspx )
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
bvillersjr



Joined: 04 Jan 2010
Posts: 15

PostPosted: Tue Jan 05, 2010 2:04 pm    Post subject: Reply with quote

Infralution wrote:
Thanks for reporting this issue. We downloaded the Xceed Datagrid evaluation and were able to replicate the problem. The issue arises because the Datagrid components (unlike most other WPF elements) don't derive from FrameworkElement. We were able to fix the Infralution.Localization.Wpf assembly to cope with this.

You can download an updated version (2.1.0) of the assembly from:

www.infralution.com/downloads/Infralution.Localization.Wpf.zip

If you remove the reference in your project to the Infralution.Localization.Wpf (version 2.0.0) assembly and then add a reference to the updated assembly this should fix the issue. We will include this fix in the release of Globalizer.NET and also update the source code on code project ( http://www.codeproject.com/KB/WPF/WPF_Resx_Localization.aspx )


Thank you. This worked for the textual values.

I have one issue remaining, and being as though I am a globalization novice, I'm not sure if my expectations are off, or if something is not5 functioning properly. I will do my best to describe the issue.

I have a slider in my application. I store a decimal for it in VB.Nets my.settings. This stored value is used at form load to set both the sliders current value and the viewport size of the Xceed 3D view.

When I change my culture, all of my controls (except for the Xceed grid again) seem to accomodate this. So for example, if I change to german, my decimal value now has a comma instead of a period. When the value is saved to the my.settings, it is saved with the comma. When I use your method of changing the culture, the slider properly accomodates the comma. The Xceed grid does not. The only errors that I get during testing revolve around the Xceed grid not liking the date format and number format of different cultures. It seems like everything else compensates for the culture change.

It it reasonable to expect that the Xceed product would as well, and that I am not setting something properly, or is this just par for the course in globalization and I am going to have to find a method of handling or converting these value to something that the Xceed grid can work with?

If the later is the answer, then if would be most grateful if you could point me to some samples of how to convert these values from any culture to the invariants format.
In any case, I will be purchaseing your product and determining how to get the Xceed grid working. Thank you again.
_________________
Regards,


Berney Villers Jr.
SimXperience.com
http://www.SimXperience.com
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Jan 05, 2010 9:55 pm    Post subject: Reply with quote

Normally when you save data to text it is best to save and read it in invariant form - otherwise you are likely to have issues if the user changes their locale in between the data being saved and being read again.

The ToString methods for numeric types and dates have an overload which allows you to specify an IFormatProvider. You can pass this parameter the culture you want the text to be formatted using. For instance:

Code:
double test = 2.4;
string text = test.ToString(CultureInfo.InvariantCulture);


You'll probably have to talk to Xceed to resolve the issues it has with different date/number formats.
_________________
Infralution Support


Last edited by Infralution on Wed Jan 06, 2010 3:38 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
bvillersjr



Joined: 04 Jan 2010
Posts: 15

PostPosted: Tue Jan 05, 2010 11:23 pm    Post subject: Reply with quote

Thank you once again for your excellent support. In just 2 days, I have been able to make great strides in my application with your products and thorough task based documentation. As always, consumers vote with their wallets. You sir, have my vote.
_________________
Regards,


Berney Villers Jr.
SimXperience.com
http://www.SimXperience.com
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Jan 26, 2010 3:08 am    Post subject: Reply with quote

Version 2.1.0 of Globalizer.NET has now been released and includes the fix for this issue. You can download it from our downloads page (www.infralution.com/downloads.html).
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
bvillersjr



Joined: 04 Jan 2010
Posts: 15

PostPosted: Sun Feb 07, 2010 8:39 pm    Post subject: TextBlock Issue Reply with quote

The new version seems to have resolved mz issue. Thanks!!!

I am now struggling with the localization of the TextBlock.

<TextBlock Grid.Row="1" TextWrapping="Wrap">
<Resx ResxName="SimXperienceCommander.FirstRunWizard" Key="TextBlock_Content1" />
</TextBlock>

This results in the following error...The property 'Inlines' is read-only and cannot be changed.

I added TextBlock Content to my scan section and this is the result.
_________________
Regards,


Berney Villers Jr.
SimXperience.com
http://www.SimXperience.com
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun Feb 07, 2010 10:19 pm    Post subject: Reply with quote

Unfortunately the TextBlock element does not support any child elements other than simple text - so you cannot localize the content like this. Instead you need to set the Text property (inside the TextBlock tag) like:

Code:
Text="{Resx ResxName=SimXperienceCommander.FirstRunWizard, Key=_TextBlock_Text}"


If you change your TextBlock elements to use the Text property before you scan with Globalizer.NET then it will convert these properly as above.
_________________
Infralution Support


Last edited by Infralution on Sun Mar 21, 2010 9:48 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
bvillersjr



Joined: 04 Jan 2010
Posts: 15

PostPosted: Sun Mar 21, 2010 4:02 am    Post subject: Reply with quote

Thanks. This is tested and works nicely.
_________________
Regards,


Berney Villers Jr.
SimXperience.com
http://www.SimXperience.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group