Kendo UI Grid - Export to Excel without server callback - kendo-ui

I want to export my kendo UI Grid data to excel without any server callback. is it possible?

The kendo grid has support for exporting the data to excel natively with no server side support needed. All you need to do is inlude the 'excel' option in the toolbar and define any options on the excel export you need.
$("#grid").kendoGrid({
toolbar: ["excel"],
excel: {
fileName: "Kendo UI Grid Export.xlsx",
filterable: true,
allPages: true
},
See the kendo demo for grid exporting to excel
Kendo Grid Export To Excel.
The reason they include a callback URL is provide legacy browser support. Documentation on proxyURL states as such, but isn't needed if you don't have to support Safari, or IE 9 and below.

Related

How to refresh kendo uploader widget using jquery

kendo uploader works fine with upload, but kendo uploader holds certain data (kendo upload status) in html after form submit. How can I refresh kendo uploader using jquery?.
I needed something like below. Googled but with no hope.
$(".k-upload").data("kendoUpload").refresh();
showfilelist is default set to true. Set it to false.
https://docs.telerik.com/kendo-ui/api/javascript/ui/upload/configuration/showfilelist

How can I fill kendo panelbar by datatable from controller in MVC c#

I not found any demo in kendo UI for binding with remote source!
The Kendo UI Panelbar doesn't support binding to remote data sources. This is the reason you haven't found any demos.

KendoGrid with in a new custom kendo ui widget

Please guide me how to make a custom kendo ui widget, like if you could refer to some tutorial or anything. Secondly the main question is that I want to use kendo grid to consume webapi and i want to use it in a widget in which and pass the datasource to this widget.
Bascially I want to make a widget which will consume the webapi using a particular url, and which will return a data source that I can add to this kendogrid widget.
Googling a little I just found:
Creating Custom Kendo UI Plugins
Creating a DataSource Aware Kendo UI Widget
Inheriting From Custom Widgets
Creating A Kendo UI MVVM Widget
I think that any and all this blogs should help you (I've written several widget and I found here all I needed).
In addition to #Emiliano's links, the Kendo Music Store demo app also contains a custom Widget bound to a DataSource that you can look at as an example:
Live demo site: http://www.kendouimusicstore.com/
Source code: https://github.com/telerik/kendo-music-store
Custom Widget source: MvcMusicStore/Scripts/App/kendo-cart-menu-widget.js
Documentation for this custom widget: http://docs.kendoui.com/tutorials/ASP.NET/Kendo%20Music%20Store/Music%20Store%20Web/kendo-music-store-web-cart-menu-widget
If you are going to use WebAPI, you will probably want to read this (The Facts On Using Kendo UI With ASP.NET WebAPI) first.
"Use WebApi" is a very broad statement, and narrowing down your approach would be the first step.

Telerik MVC Chart: How to change databinding mode at client side using javascript?

I have a telerik MVC barchart that uses serverside binding during startup for performance purpose. Afer the page is loaded. I want to change the databinding to AJAX, so the chart can update itself responding to other events. Can the databinding mode be updated using javascript
You could pass the values you want to initially load to the Chart constructor and also define an ajax binding and select method. After that once the page is loaded you can refresh the Chart with the following code
<code>
$('#chartID').data().tChart.rebind()
</code>

MVC 3- Grid. Export Data into Excel and PDF

I am using MVC3 Web Grid. I need to export the data into excel 2003 and Higher and to PDF.
I have two button under the grid, When I click on the first button, I should be able to export to excel 2003 and save the data.
When I click on the second button, I should be able to export in to PDF format.
Using Grid View in Webforms, I have done that, but using MVC3, I have not done that.
Any directions please? Is there anything that comes up with in MVC3 framework for export functionality.
Thank you
Is there anything that comes up with in MVC3 framework for export functionality.
No nothing. To export to Excel you could use CSV and use a controller action which will fetch the data from wherever you fetched it initially to display on the grid and return a File content with CSV:
public ActionResult ExportToExcel()
{
byte[] csvData = ... fetch the data from your repository and convert to CSV
return File(csvData, "text/csv", "data.csv");
}
To export to PDF, well, nothing built-in .NET. You will need a third party library. Personally I use iTextSharp to achieve this functionality.
You can check here for an easy way to export to CSV. You don't have to worry about converting your data to CSV, this will do it.

Resources