I've created an website available in three languages: english, portuguese and spanish.
It's everything working fine except for one thing: it was not updating a BoundField when an accentuated word is loaded into it.
Below is the field which doesn't update in the gridview at MEMGridView.ascx:
<asp:BoundField DataField="Ocupacao" HeaderText="Ocupação" SortExpression="Ocupação" meta:resourcekey="BoundFieldResource9">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
At App_LocalResources
are three files with this values:
When the page loads for the first time it exhibits "Fill Rate". Then I change the language to spanish and it exhibits "Ocupación". If I return to load the page in english it updates all fields, except for the accentuated ones. So it continues to show "Ocupación" instead of "Fill Rate".
I have no clues of what can be happening.
-- Update - Additional Info --
MEMGridView is a UserControl inside of DashBoard.aspx. Everytime someone changes the language value in ddlLanguage (dropdownlist) or clicks on Update button a postback is generated.
This is the MEMGridView event suposed to update the fields (actually, it updates all fields except the accentuated ones).
public partial class MEMGridView : UserControl
{
...
protected override void FrameworkInitialize()
{
if (!string.IsNullOrEmpty(Request["ddlLanguage"]))
{
string str = Request["ddlLanguage"];
//Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(str);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(str);
}
else
{
string preferredLanguage;
if (Request.QueryString["Language"] != null)
preferredLanguage = Request.QueryString["Language"];
else
preferredLanguage = Request.UserLanguages[0];
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(preferredLanguage);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(preferredLanguage);
}
base.FrameworkInitialize();
}
Encountered same problem. Fixed by replacing the BoundField with TemplateField, just like that:
<asp:TemplateField ...>
<ItemTemplate><%# Eval( "Ocupacao" ) %></ItemTemplate>
</asp:TemplateField>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With