Translating a Button field in a databound GridView

Vote:
 

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">
                <Columns>
                    <asp:BoundField DataField="!" />
                    <asp:ButtonField ButtonType="Button" CommandName="index" Text="<%=EPiServer:Translate('indexbutton')%>" />
                </Columns>
            </asp:GridView>

 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!

 Cheers,

 Andy

#26630
Dec 14, 2008 19:49
Vote:
 
Have you tried the asp.net resources instead? Text="<%$Resources: EPiServer, indexbutton%>"
#26632
Dec 14, 2008 22:21
Vote:
 

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.

Cheers,

Andy

#26633
Dec 15, 2008 9:56
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.