Hello everyone.
I am trying to localize a project using an UltraGrid. We are using Infragistics 11.2.
Visual Studio usually creates the appropriate entries for the .resx file as soon as you mark the form as "Localizable". This is not the case for the UltraGrid, at least not entierly. If I have a column bound to a datasource and leave the properties unchanged, the header is named after the source's property name and so I cannot localize it anymore. If I add a blank to the headers name, the entry in the .resx files is made and I can do the translation. But I guess this is just a work around.
So here's my question: Is there any other way to localize bound column headers?
Regards.
Exact same issue here. We use a third party application to translate our resources and create localized resources. It translates the binaries. The problem is that if you don't "change" the header caption to something different than the key in the datasource then (as described above) the Header Caption resource is not placed in the resource file to begin with. Our translator app has nothing to automatically translate. So... Is there a setting on the grid or someway of "forcing" the wingrid to write the header caption to the resource even if it's the same as the key? We have over one hundred wingrids in our app and to go in and tweak every column on every grid would take forever. There has to be a better way. Has anybody solved this problem?
Thanks,
Derek
Derek,
I have opened a support case for you and I am going to investigate the issue you have described. The reference number for the case is CAS-121852-F0C9R5. I will get back to you with an update as soon as I have been able to reproduce the issue.
Hi,
In v10.3, we've been setting the caption (depending on the language selected) at runtime as you suggested.
Been thinking if we could ditch this way of doing things.
I am trying out v22.2 but the column name still changes randomly in the designer. In my case:
but the resulting change does not get updated in the resx file automatically :
Hence, my question, what is the best practice to localize ultragrids? Can we not just put the relevant caption in the language's resX file and let magic be done by itself as is the case with other controls?
Changing the form language and inserting the captions is not really an option, since we are using the Multilingual App Toolkit to manage the translations. The captions get written over on each build.
Veevek
The difference is that a label control's Text property is changed by default, so it always serializes. When you put the label on the form, the designer automatically sets the Text of the label to the name of the control. The label's Text is therefore different from the default and needs to be serialized.
If you were to Reset the labels text so that it is empty and does not require serialization, then that label's text would not be placed into the resx file and you would have the same issue.
With the column header, the header's text is not explicitly set to the key of the column. It simply resolves to display the key when the text (Caption) is empty.
The only way we could fix this would be a breaking change in the column header's behavior where the column header always serializes it's caption, even when it's the same as the key.
My suggestion would be to manually add string resources to your resx file, then set the header captions in code at run-time.
This is not correct. If you place a new label this appears in resx file: label1.Text with value=label1
Hello,
It is expected behavior, default strings are not localized, for example place a label on your form, you will notice that in the resx file you don't have a record for label's Text property until you change it. So the solution for you is to change or make any change of the caption of the column for default language, in order to generate record into the resx file and then to localize it.
Please let me know if you have any further questions.
Hi, Is this topic resolved?
Thank you.