SetOptions and Toolbar

4 posts, 0 answers
  1. Gusev
    Gusev avatar
    83 posts
    Member since:
    Dec 2012

    Posted 20 Dec 2017 Link to this post

    Hello guys,

    I need this functionality ( but there are some problems.

    I want to clarify one thing:
     - You have a grid (you may check your own link -
     - In console I write:
    var grid = $(".k-grid").data("kendoGrid");
    and suddenly the toolbar breaks down.
    I've checked a javascript version ( and everything is fine over there.

    Let's check how "grid.options.toolbar" looks like:
    {name: "create"}{name: "save"}{name: "cancel"}


    { command: { { name: null, buttonType: "ImageAndText", text: "create"}, ...
    So, it seems as "grid.options.toolbar" is useless when we talk about "MVC Wrappers".

    The most important part -
    Yes, I see this note "When using the Grid MVC wrapper, any server templates will not be retrieved by the getOptions", but what can be counted as a "server template" talking about "toolbar"? If I use Kendo MVC, then everything or only when I use this one ".ToolBar(s => s.Template("<a random template>"))"?

    So should I use what's described in this link?

    Thank you for your time and sorry, probably I'm not the first who's asked it
    Have a nice day
  2. Viktor Tachev
    Viktor Tachev avatar
    2500 posts

    Posted 22 Dec 2017 Link to this post


    Indeed when using a toolbar Template() it will not be persisted out of the box by getOptions. In that scenario it is recommended to use the approach illustrated in the example you are referring to

    This is necessary as the server-side templates are rendered server side. When restoring them via setOptions the templates need to be reinitialized to be displated correctly. 

    Viktor Tachev
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Jigisha
    Jigisha avatar
    1 posts
    Member since:
    Mar 2019

    Posted 27 Sep 2019 Link to this post

    Hi Viktor,

    Can you please provide example for persisting default create toolbar generated using below code. How do I handle conditional part in this scenario.

    .ToolBar(toolbar =>
              if (condition)

  4. Viktor Tachev
    Viktor Tachev avatar
    2500 posts

    Posted 01 Oct 2019 Link to this post

    Hello Jigisha,


    In order to implement the behavior you can add similar condition when restoring the Grid settings. You can access a field in JavaScript using the approach described in the stackoverflow thread below.

    When this is available you can construct the Grid options object accordingly and call setOptions.


    Viktor Tachev
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top