I have a custom forms grid control that has a collection property which contains object which has two string properties set to be localized. This works as expected, except the Name (the key) used in the .resx file is too generic. As an example, it will assign the Name to be resource.Label, resource.Label1, resource.Label2. This becomes a problem when an entry is added to the collection as everything is shifted and therefore incorrect values are resolved from the .resx file.
Is there any way to hook into the .resx writing process and in that way customize the key (the value used in the Name field)? I am hoping to be able to set this to be the grid's name + field name (the collection is basically a collection of fields), e.g. grdOrder.OrdNum.Label.
Thanks in advance,
Trausti
Looks like I did not explain the situation clearly enough.
Here is the collection property in the grid:
Description("Collection of Column Info objects"), _
Category("Oppenheimer Properties"), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
Public ReadOnly Property ColumnInfo() As ColumnInfoCollection
Get
If columnInfos Is Nothing Then
columnInfos = New ColumnInfoCollection
End If
Return columnInfos
End Get
End Property
This collection contains objects which are made up of key (string) and another object called DataLink. The DataLink object contains number of properties, of which one is localized:
Description("Label of the field"), _
DefaultValue(""), _
Localizable(True), _
Category("Oppenheimer Properties"), _
NotifyParentProperty(True)> _
Property Label() As String
Get
Return lbl
End Get
Set(ByVal Value As String)
lbl = Value
End Set
End Property
Let's say I have 3 DataLink objects in my ColInfo collection. In the .resx file VS will use resource.Label, resource.label1 and resource.label2. This is my problem.
Again, in short, I am asking if somebody knows if, on designer level, I can provide the key used by VS in the .resx files.