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

Exel along with template

1 Answer 36 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 09 Mar 2019, 12:22 AM

Current I have something like

 

.ToolBar(tools =>
{
tools.Excel(); 
tools.Template(
@<text>
  <div class="show-declined-checkbox-group">
  <input class="k-checkbox" id="ShowDeclinedItemsCheckBox" name="ShowDeclinedItemsCheckBox" type="checkbox">
  <label class="k-checkbox-label" for="ShowDeclinedItemsCheckBox">Show Declined Items</label>
  </div>
  <div class="show-appoved-checkbox-group">
  <input class="k-checkbox" id="ShowApprovedItemsCheckBox" name="ShowApprovedItemsCheckBox" type="checkbox">
  <label class="k-checkbox-label" for="ShowApprovedItemsCheckBox">Items to be Approved</label>
            <span id="needs-approval-span" class="badge badge-light"></span>
  </div>
  </text>
); 
})

But I don't see the 'Export to Excel' button. Is the template somehow overriding the Excel button? How do I have both the Excel button and a "custom" toolbar?

 

Thank you

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 12 Mar 2019, 11:54 AM
Hi Kevin,

Indeed, the toolbar template overwrites any built-in toolbar commands that you may have specified. To include the Export to Excel button in your custom toolbar, you can add the following markup:
<a role="button" class="k-button k-button-icontext k-grid-excel" href="\\#"><span class="k-icon k-i-file-excel"></span>Export to Excel</a>

The Grid will automatically recognize it by the k-grid-excel class name, so you do not need to manually trigger export when it is clicked.

Regards,
Tsvetina
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.
Tags
Grid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or