Custom export to excel button

2 posts, 1 answers
  1. Peter
    Peter avatar
    14 posts
    Member since:
    Dec 2013

    Posted 21 Nov 2014 Link to this post

    I have a grid with a custom toolbar template defined, full of custom controls. I would like to add a button to export the grid contents to excel, however based on the example .ToolBar(tools => tools.Excel()) seems to just arbitrarily add a button to the toolbar. Is there a way to add my own button to my toolbar template and have it be recognized as the export to excel button?
  2. Answer
    Dimiter Madjarov
    Dimiter Madjarov avatar
    2312 posts

    Posted 24 Nov 2014 Link to this post

    Hi Peter,

    In the current case you could directly include the markup required for the Excel export button in the template.
    <a class="k-button k-button-icontext k-grid-excel" href="#"><span class="k-icon k-i-excel"></span>Export to Excel</a>

    The Grid will recognize the button by it's k-grid-excel CSS class.

    Dimiter Madjarov

    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.

Back to Top