This is a migrated thread and some comments may be shown as answers.

Grid Toolbar Example in Razor?

8 Answers 333 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hatton Point
Top achievements
Rank 1
Hatton Point asked on 21 Dec 2012, 05:59 PM
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.

8 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 25 Dec 2012, 10:53 AM
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!
0
Hatton Point
Top achievements
Rank 1
answered on 26 Dec 2012, 10:40 PM
Thanks. I cannot verify but it looks similar to what I was able to figure out.
0
Fernando
Top achievements
Rank 1
answered on 23 Oct 2014, 02:19 PM
It is possible add custom buttons like: toolbar.Custom().Text("Nuevo Puesto").Name("New")
             .Action("Create", "WorkStations"); 
​with this sintax?
0
Petur Subev
Telerik team
answered on 27 Oct 2014, 09:31 AM
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.

 
0
Curt Rabon
Top achievements
Rank 1
Veteran
answered on 02 Jul 2015, 07:11 PM

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.

0
Vladimir Iliev
Telerik team
answered on 06 Jul 2015, 11:05 AM
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
0
Curt Rabon
Top achievements
Rank 1
Veteran
answered on 06 Jul 2015, 01:24 PM
So, is it documented anywhere at all in your documentation (including all API's..JavaScript, etc.) ?  Or is this actually an undocumented feature?
0
Vladimir Iliev
Telerik team
answered on 08 Jul 2015, 08:11 AM
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
Tags
Grid
Asked by
Hatton Point
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Hatton Point
Top achievements
Rank 1
Fernando
Top achievements
Rank 1
Curt Rabon
Top achievements
Rank 1
Veteran
Vladimir Iliev
Telerik team
Share this question
or