Grid Toolbar Example in Razor?

9 posts, 0 answers
  1. Hatton Point
    Hatton Point avatar
    2 posts
    Member since:
    Dec 2012

    Posted 21 Dec 2012 Link to this post

    Hi. I'm looking for an example in Razor like the Grid Toolbar demo found here: http://demos.kendoui.com/web/grid/toolbar-template.html. I've put together the basics and it is working but a more complete example would be great. The docs found here: http://docs.kendoui.com/api/web/grid#toolbar-array also do not provide help in getting the Razor syntax correct.
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 25 Dec 2012 Link to this post

    Hello Hatton,

    I am sorry that the MVC code is not available, we are going to fix this for the upcoming release.

    Anyway here is a snippet which will give you the idea.

    .ToolBar(tb=>tb.Template(@<text>
                This is custom toolbar text
                @item.CreateButton()
                Some more here
                @item.SaveButton()
    </text>))


    All the best,
    Petur Subev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Hatton Point
    Hatton Point avatar
    2 posts
    Member since:
    Dec 2012

    Posted 26 Dec 2012 Link to this post

    Thanks. I cannot verify but it looks similar to what I was able to figure out.
  5. Fernando
    Fernando avatar
    6 posts
    Member since:
    Nov 2011

    Posted 23 Oct 2014 in reply to Petur Subev Link to this post

    It is possible add custom buttons like: toolbar.Custom().Text("Nuevo Puesto").Name("New")
                 .Action("Create", "WorkStations"); 
    ​with this sintax?
  6. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 27 Oct 2014 Link to this post

    Hello Hatton,

    Through the template and the example that I shared you can create a hyperlink (an anchor element) with the k-button class and point its href to the URL that you want. You can even use the Html.URL helper to create the URL.

    Kind Regards,
    Petur Subev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. Curt Rabon
    Curt Rabon avatar
    45 posts
    Member since:
    Dec 2008

    Posted 02 Jul 2015 in reply to Petur Subev Link to this post

    Please tell me where in the MVC documentation is the .CreateButton() and .SaveButton() mentioned.  I can't find it. I did not know that the Grid object had these methods, and did not know you could customize the built-in add/save/cancel button text this way.

  8. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 06 Jul 2015 Link to this post

    Hello Curt,

    The method is not listed in the documentation as it's not part of the Fluent API, instead it's a method inside the Grid class which can be used inside the templates.

    Regards,
    Vladimir Iliev
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  9. Curt Rabon
    Curt Rabon avatar
    45 posts
    Member since:
    Dec 2008

    Posted 06 Jul 2015 in reply to Vladimir Iliev Link to this post

    So, is it documented anywhere at all in your documentation (including all API's..JavaScript, etc.) ?  Or is this actually an undocumented feature?
  10. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 08 Jul 2015 Link to this post

    Hello Curt,

    These methods can be found in the Grid class documentation (outside the Fluent API)  - please check the link below:

    Regards,
    Vladimir Iliev
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET MVC is VS 2017 Ready