Translating a Button field in a databound GridView

Andy Brodie
Member since: 2006

Hi all,

 Can anyone explain to me how to achieve the seemingly simple?

I have a GridView, it contains 2 columns, a BoundField and ButtonField.  How do I make a call to one of EPiServer's many translate functions within the ButtonField group?

            <asp:GridView runat="server" ID="vppSelectors" AutoGenerateColumns="false" OnRowCommand="EventRow">
                    <asp:BoundField DataField="!" />
                    <asp:ButtonField ButtonType="Button" CommandName="index" Text="<%=EPiServer:Translate('indexbutton')%>" />

 The above represents someting that is obviously wrong, but it shows the level of desperation that I've reached (trying everything else I can think of) trying to make it work.

Oh, I'd like to translate the HeaderText too (trying it in the code-behind but this seems equally difficult without understanding the controls that the Field classes generate and poking the Controls directory, but that's just beyond evil).

 Any advice gratefully appreciated!



#26630 Dec 14, 2008 19:49
  • Eric
    Member since: 2007
    Have you tried the resources instead? Text="<%$Resources: EPiServer, indexbutton%>"
    #26632 Dec 14, 2008 22:21
  • Andy Brodie
    Member since: 2006

    Hi Eric,

    That did the trick, thanks very much!

     I didn't realize you if you replace the slashes with periods, i.e.

    /easysearch/plugin/admin/index becomes easysearch.plugin.admin.index

     that you could do this.



    #26633 Dec 15, 2008 9:56