locked
Globalisation, GridView & EmptyData Template RRS feed

  • Question

  • User1808991018 posted

    I've been thinking it was my fault and that I was doing something wrong to achieve this error - however I dont think i am.

     I have a gridview with a number of columns described, each of which have a definition in the LocalResource for the page. When the culture is changed, these change as expected. However in my empty datatemplate as shown below, the globalised label doesn't display the correct culture value.

    <EmptyDataTemplate>

    <p><asp:Label ID="lblNoData" runat="server" CssClass="error" meta:resourceKey="lblNoDataResource1" /></p>

    </EmptyDataTemplate>

    lblNoDataResource1.Text Geen Gegevens Beschikbaar Error message if no information is available for the account details table

    Any advice?

    TIA,

    Monday, February 19, 2007 11:23 AM

Answers

  • User-503940700 posted

    Try to place the label out of the EmptyDataTemplate and check if the localized text appears properly if it is outside the gridview. If this works then there is a problem with EmptyDataTemplate.

    Let me know the results.

    Vivek

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 21, 2007 1:28 AM

All replies

  • User-503940700 posted

    What exactly the lable displays whenever you change the culture? Also, let me know the corresponding value in the reosurce file (make sure that the identifier name is same as in the reosurce file, i.e.lblNoDataResource1).

    Vivek

    Monday, February 19, 2007 2:56 PM
  • User1808991018 posted

    It displays the value as found in the default culture - which happens to be the english language version

    I cant seem to paste the resource table so here it is in it's xml form

    MyPage.aspx.nl-NL.resx:
    <data name="lblNoDataResource1.Text" xml:space="preserve">
        <value>Geen Gegevens Beschikbaar</value>
        <comment>Error message if no information is available for the account details table</comment>
      </data>

    MyPage.aspx.resx:
    <data name="lblNoDataResource1.Text" xml:space="preserve">
        <value>No Data To Display</value>
        <comment>Error message if no information is available for the account details table</comment>
      </data>

    Tuesday, February 20, 2007 3:29 AM
  • User-503940700 posted

    Try to place the label out of the EmptyDataTemplate and check if the localized text appears properly if it is outside the gridview. If this works then there is a problem with EmptyDataTemplate.

    Let me know the results.

    Vivek

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 21, 2007 1:28 AM
  • User1808991018 posted

    Awww *insert swear words*

    I've just spotted my mistake. I've just realised that the only control in my application which is skinned is the GridView. Thus overriding my localised controls.

    Many thanks for your assistance with this issue.

    Wednesday, February 21, 2007 3:50 AM