Hi,
I'm trying to create a pivot of a translation table. Basically the table is like that :
SystemText(Category, Name, LanguageCode, Text)
I have created a model object which has these fields as properties and I'm using NHibernate to get the data from the database.
Now what I want to display is a grid to edit the translations that will display on the same line the category, the name of the text and all the available languages (languages that are not fixed in advance). For example :
Category | Name | English | French | German
I've managed to create a Linq query to create the pivot that I will need to do that. It looks like that
Dim test = From systemText In _systemTexts _
Group systemText By Key = New With {Key systemText.TextCategory, Key systemText.TextName} Into g = Group _
Select New With {Key .TextCategory = Key.TextCategory, _
Key .TextName = Key.TextName, _
.Languages = g.ToDictionary(Function(st) st.LanguageCode, Function(st) st.Description)}
Now the only trouble I have is to bind the objects to my gridlist. I would create the columns of the grid dynamically when the form is loading, depending on the languages available. I thought that using something like Languages("EN") in the DataMember property would work, but it doesn't seem so.
I'm a bit blocked now, I thought about using something else to replace the Dictionary for the languages but I don't really see what I can use.