Search code examples
c#asp.netlocalizationglobalization

Implicit localization in a bound column


I have an asp.net file i'm trying to localize implicitly. I was able to do so for labels and such but can't figure out how to localize features such as the HeaderText in asp:BoundColumn.

My Column looks like this:

<asp:BoundColumn DataField="QUICK_DESCRIPTION" HeaderText="Description">
</asp:BoundColumn>

How can I store a HeaderText value in my .resx file?

I tried using meta:resourcekey="Description" but the resource file wouldn't accept Description.HeaderText as a valid identifier.

//I am using .net 4.0 and visual studio 2012


Solution

  • I figured it out. There is probably another way to do this but I created a global resource file then in the back code I looped through every DataGrid then every Column, and used the DataGrid ID and the original Header Text to make an ID I could reference in the global resource file.