MVC 6 Custom Toolbar

4 posts, 0 answers
  1. Arie
    Arie avatar
    16 posts
    Member since:
    Jun 2014

    Posted 01 Oct 2015 Link to this post

    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

     


     
     
  2. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 05 Oct 2015 Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Arie
    Arie avatar
    16 posts
    Member since:
    Jun 2014

    Posted 05 Oct 2015 in reply to Rosen Link to this post

    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

  5. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 06 Oct 2015 Link to this post

    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
Back to Top
UI for ASP.NET MVC is VS 2017 Ready