Try our conversational search powered by Generative AI!

Translating a Button field in a databound GridView


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!



Dec 14, 2008 19:49
Have you tried the resources instead? Text="<%$Resources: EPiServer, indexbutton%>"
Dec 14, 2008 22:21

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.



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.