Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > Grid > Grid insert button text
Telerik MVC Extensions are no longer supported (see this page for reference). In case you have inquiries about Kendo UI Complete for ASP.NET MVC, post them in the pertinent Kendo UI forums.

Not answered Grid insert button text

Feed from this thread
  • Mark Shortt avatar

    Posted on May 23, 2011 (permalink)

    Hi

    Can you tell me how to change the text of the insert button on the grid? I have tried using the Custom Command  method but that calls the method outside of the grid, instead of entering the new record within the grid

    Thanks

    Mark

  • Atanas Korchev Atanas Korchev admin's avatar

    Posted on May 23, 2011 (permalink)

    Hi Mark Shortt,

     The only way to customize the Insert button text is by tweaking the grid localization.

    Kind regards,
    Atanas Korchev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  • Mark Shortt avatar

    Posted on May 23, 2011 (permalink)

    ok, thanks

  • Joe avatar

    Posted on Jun 23, 2011 (permalink)

    Is there any way to customize the text for a grid on a specific page without changing it site-wide?

  • Dimo Dimo admin's avatar

    Posted on Jun 24, 2011 (permalink)

    Hi Joe,

    You can use a Grid localization file on a specific page by setting Culture and UICulture only on that page.

    http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-grid-localization.html

    This approach is actually used in our online demos where the localization capabilities of the components are demonstrated on specific pages only.

    Best wishes,
    Dimo
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  • Joe avatar

    Posted on Jun 24, 2011 (permalink)

    Worked, thanks.

  • Aaron avatar

    Posted on Jul 25, 2011 (permalink)

    Personally, I wouldn't use the UICulture hack; this could have unintended side-effects and is extremely cumbersome if you're doing a lot of customization.

    A faster way on single-language sites is to use a single line of jQuery:

    $("#Widgets .t-grid-add").first().text("Add new widget");

    You can even use this for master-detail grids, if the detail insert should have a different title (which is impossible to do by playing with culture settings alone). Example markup:

    @(Html.Telerik().Grid<Widget>()
        .Name("Widgets")
        ...
        .DetailView(v => v.ClientTemplate(
            Html.Telerik().Grid<Part>()
                .Name("WidgetParts_<#=Id#>")
                ...
                .ToolBar(b => b.Insert())
                .ClientEvents(e => e.OnLoad("partsGrid_OnLoad"))
                .ToHtmlString())))

    and the corresponding script:

    function partsGrid_OnLoad(e) {
        $(this).find(".t-grid-add").first().text("Add part");
    }

    Very easy.  And if you really need i18n then you can insert a code nugget into the text() parameter which looks up a localization string.

  • Posted on Jul 28, 2011 (permalink)

    Great solution. One thing I would add, in case you're using GridButtonType.ImageAndText:

    $("#Widgets .t-grid-add").first().text("Add new widget").prepend("<span class='t-icon t-add'>");

    Otherwise, you'll lose the icon altogether.


  • Robert avatar

    Posted on Apr 19, 2012 (permalink)

    Nevermind.

  • Posted on May 14, 2012 (permalink)

    Mark, your answer is the best from what I can tell, but you need to change it from 

    $("#Widgets .t-grid-add").first().text("Add new widget").prepend("<span class='t-icon t-add'>");

     to

    $("#Widgets .t-grid-add").first().text("Add new widget").prepend("<span class='t-icon t-add' />");

    Notice the closing '/' at the end of the span tag.

  • Posted on May 14, 2012 (permalink)

    Thanks, Matthew. Good catch.

  • Chillax avatar

    Posted on Jun 21, 2012 (permalink)

    Hi Everyone

    I want to add a new button in telerik MVC grid in the following sequence.
    Edit,MY Custom Button,Delete
    Please see the image below that will clear what i want. After adding this button i want to show a popup but that's task will be done later.

    Image Link : http://i.imgur.com/aS5lQ.jpg

    Kind Regards

  • Posted on Jun 25, 2012 (permalink)

  • Nancy avatar

    Posted on Aug 29, 2012 (permalink)

    How to change the text of Edit button . I m using  2010.3.1318

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > Grid > Grid insert button text
Related resources for "Grid insert button text"

ASP.NET MVC Grid Features  |  Documentation  |  Demos  |  Telerik TV ]