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

MVC 6 Custom Toolbar

5 Answers 149 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Arie
Top achievements
Rank 1
Arie asked on 01 Oct 2015, 11:36 AM

We are currently updating an application to use MVC 6 with the current set of beta release from Telerik with the MVC wrappers.We are running into one sticking point that the demos do not address and I cannot find anywhere in the docs where it does either.

On out pages we have multiple grids with custom toolbars deployed using the common syntax

       .ToolBar(toolbar =>
        {
            toolbar.Template(
                @<text>
                   //Bunch of code remove for brevity
                </text>);
        })

 

However, this throws an error and upon further inspection the toolbar.Template method doesn't exist. We did find ClientTemplate but we cannot seem to get this to work. How are we supposed to implement a custom toolbar now? We saw that there may be a way in which we could specify a ViewComponent but it was not very clear.

If you could provide us an example this would go a long way to us getting this out the door.. So far all of the other controls seem to be working no problem.

 

Thanks,
AJ

 


 
 

5 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 05 Oct 2015, 06:55 AM

Hello Arie,

Indeed, since the Grid widget does not support server-rendering, server templates were removed. You should use the client template instead.

Regards,
Rosen
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
Arie
Top achievements
Rank 1
answered on 05 Oct 2015, 01:07 PM

Thank you for the response but could we get an example of "how" these custom client side templates are supposed to work. Since we cannot set a template id like we do with some of the detail templates we are wondering the best path of least resistance forward.

 One of my people attempted to use a client side template as we have with the toolbar.Template syntax and it just blows up. Is there a way in which we can use the Telerik templating scheme like we do for the grid item details.

 Or can we use a ViewComponent for this possibly?

 

Thanks for your insight,
AJ

0
Rosen
Telerik team
answered on 06 Oct 2015, 03:16 PM

Hello Arie,

Indeed, when having more complex toolbar template a ClientToolbarId option will be very useful and we will consider adding such option. Currently, it is still possible to load an external template. Please take at the attached View, which demonstrates how to implement it.

Regards,
Rosen
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
Marcel Härry
Top achievements
Rank 1
answered on 06 Feb 2017, 11:29 AM

How can I embed the standard grid buttons
Create() and Save()
this template? 

0
Rosen
Telerik team
answered on 06 Feb 2017, 03:34 PM

Hello Marcel Härry,

I'm afraid that it is not possible to use the Create or Save command builder configuration when using toolbar template. You should either use the builders as shown in this demo, or use custom buttons inside the toolbar template which to use the Grid API (createRow and saveChanges) to trigger the appropriate actions.

Regards,
Rosen
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Arie
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Arie
Top achievements
Rank 1
Marcel Härry
Top achievements
Rank 1
Share this question
or