locked
Gridview delete and edit button headertext issue RRS feed

  • Question

  • User-1131110536 posted

    hi

    when i use the gridview control, delete button and edit button in local host, the headerText on my delete button and edit button shows the danish language, but when i upload it to my website it shows on english, and i can not change it. i dont now what to do about it, i can not find something on google so i need your help to it.

    here is my delete button control

    <asp:CommandField ShowHeader="true" HeaderText="Slet siden" ControlStyle-CssClass="btn btn-default btn-forside" ShowDeleteButton="True" />

    Thursday, January 26, 2017 1:52 PM

Answers

  • User-1131110536 posted

    problem is solved with this in the gridview, that works fine.

    thanks for your help.

    <asp:ButtonField CommandName="Edit" Text="Rediger" />

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 31, 2017 12:00 PM

All replies

  • User-359936451 posted

    You need to set the UI culture in the page. check out this link...

    https://msdn.microsoft.com/en-us/library/bz9tc508.aspx

    And the common approach of using resources....

    https://msdn.microsoft.com/en-us/library/ms227427.aspx

    Thursday, January 26, 2017 2:14 PM
  • User-1716253493 posted

    Try change this

    <!DOCTYPE html>
    <html lang="en">
      ...
    </html>

    and read this

    http://getbootstrap.com/css/

    Thursday, January 26, 2017 2:58 PM
  • User-1131110536 posted

    i can not get it to work it still shows delete on then gridview button, i have tryiet this in webconfig 

    <globalization uiCulture="da" culture="da-DK" />

    and this one her on the page 

    <%@ Page UICulture="da" Culture="da-DK" %>

    i have also tryiet this  on masterpage

    <html lang="da">

    nothings work

    just so that you now it is on this button in gridview i want it to be danish

    <asp:CommandField ShowHeader="true" HeaderText="Slet siden" ControlStyle-CssClass="btn btn-default btn-forside" ShowDeleteButton="True" />

    here is all the code for gridview if that helps

        <asp:GridView ID="gvAlleSider" CssClass="table table-bordered table-hover" AllowPaging="True" PagerStyle-CssClass="pagination-ys" runat="server" AutoGenerateColumns="False" DataKeyNames="fldId" DataSourceID="SqlAlleSider">
                                <Columns>
                                    <asp:TemplateField HeaderText="Sidens navn" SortExpression="fldOverskrift">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtSideTitel" runat="server" Text='<%# Bind("fldOverskrift") %>'></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfv" ControlToValidate="txtSideTitel" runat="server" CssClass="error" ErrorMessage="Du mangler at udfylde feltet" />
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblSideTitel" runat="server" Text='<%# Bind("fldOverskrift") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Rediger side">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="hlRedigerSide" CssClass="btn btn-default btn-forside" Text="Rediger siden" runat="server" NavigateUrl='<%# "rediger-side.aspx?sideID=" + Eval("fldId").ToString()%>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <%--  <asp:CommandField HeaderText="Rediger Titel" ControlStyle-CssClass="btn btn-default btn-forside" ShowEditButton="True" />--%>
                                    <asp:CommandField ShowHeader="true" HeaderText="Slet siden" ControlStyle-CssClass="btn btn-default btn-forside" ShowDeleteButton="True" />
                                </Columns>
                            </asp:GridView>

    What i am doing wrong Laughing

    Tuesday, January 31, 2017 10:06 AM
  • User-1131110536 posted

    problem is solved with this in the gridview, that works fine.

    thanks for your help.

    <asp:ButtonField CommandName="Edit" Text="Rediger" />

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 31, 2017 12:00 PM