Hi all
I am using object list as datasource, so key property could not be change, and I can't use key as the Text ID. Is there any other way to set the grid's column's textId other than the key property??
BR
Bryan
Hello Bryan,
I believe that you are able to change the Header Text of any column like:
ultraGrid1.DisplayLayout.Bands[Key].Columns[Index].Header.Caption =
"Desired Text";
Please let me know if you need any further help.
Danko Valkov"] Hello Bryan, I believe that you are able to change the Header Text of any column like: ultraGrid1.DisplayLayout.Bands[Key].Columns[Index].Header.Caption = "Desired Text"; Please let me know if you need any further help.
Yes, and actually, my question was not detail enough. Sorry.
I believe UltraWinGrid use the key property for langauge resources look up. if the key does not match the column's key property, grid will use the key has the caption, for example, "ClientId". but i dont control the resources files, and the TextId for Client Id field is not "ClientId", but "Client Ref Id", so I need some way to set the column's TextId to "Client Ref Id" to display the correct caption in different langauges from the resource files.
still looking for an answer.
I do not understand your question. What is "grid's column's textId"?
TextId is a property name of winform control which is used to get the caption string from the resource file base on the app. current culture.
For UltraWinGrid from my observation, the "key" property in grid's column is doing the same thing. Because I am using object as datasource, the key is equal to the object's property name, and could not be change.
The object's property name is not the same as the name string in my resource file,so I have to make a duplicate in the resource file with the same name as the object's property name.
Does the UltraWinGrid's column has property do the same job as the TextId does other than the key property?
Hi,
I'm still having a hard time understand what you are trying to do here. You appear to be trying to localize the column captions in the grid by using a resource from a resource file. There's no property in the grid to link a property in the grid to a resource. You would have to do this in code and set the Caption property on the column to the value from the resource.
The Caption property is decorate with Localizable attrible, and UltraWinGrid's column use the "key" property as the id to find the localizable attribute.
My problem is that we had the resources files, but the localizable key wasn't defined by me, for example, in the resource file, Id: "Trade Id" value: "Order number" is defined by others. You see the key is a string, but model property couldn't; we could not have space between words for a class property, so i need to add another resource record, Id: "TradeId" value:"Order number. ", i need to do this because I could not find a property from the UltraWinGrid's column can be use as the resource searching id other than the "key" property which could not be modify if the datasource is an object model.
The Caption property is decorated with the Localizable attribute, which is supposed to make it support localization via the form's Localizable and Language properties. There is an MSDN walkthrough on the subject here...from what I remember the way it works is, the form maintains different resx files for each culture that you provide support for, and the designer sets the Caption based on the value for that culture.