Hi there
Thanks for the tip. I
have now found the LocalizeDataGrid code, and I have modified it as follows…
Public Shared Sub
LocalizeGridView(ByRef grid As GridView, ByVal
ResourceFile As String)
Dim
col As DataGridColumn
Dim
key As String
Dim
localizedText As String
For
Each col In
grid.Columns
'Localize
Header Text
key = col.HeaderText
If
key <> "" Then
localizedText =
Services.Localization.Localization.GetString(key & ".Header",
ResourceFile)
If
localizedText <> "" Then
col.HeaderText =
localizedText
End
If
End
If
Next
End Sub
I am not confident about this because I could find no Grid
View equivalent to DataGridColumn. But I
cannot taest it because I cannot find where to put the LocalizeGridView(dgIssueViewList,
Me.LocalResourceFile) code that calls it.
You see my GridView is nested in a DataList and is
initiated by this sort of code
<asp:GridView
id="dgIssueViewList"
width=525
BorderWidth=0
CellPadding=0
CellSpacing=4
AutoGenerateColumns=false
runat=server
DataSource='<%# GetViews(Eval("ItemID")) %>' Visible=true
EnableViewState=false
HeaderStyle-HorizontalAlign="Justify">
<Columns >
<asp:TemplateField
Headertext="View"
headerstyle-cssclass="NormalBold"
ItemStyle-VerticalAlign="Top" HeaderStyle-HorizontalAlign="Left">
<itemtemplate>
Etc…
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Putting LocalizeGridView in the GetViews function does not
work. I need something for the GridView like
the DataGrid’s OnItemDataBound event.
Of course I could build the whole thing up with placeholders
and user controls and localize it that way but I don’t know what it would do
for speed.
Any suggestions?
Kind regards
Geoffrey