KendoStarter
KendoStarter

Reputation: 139

Kendo SpreadSheet: How to bind excel file data with kendo SpreadSheet from asp.net mvc action

I am have small experience in technology. i just started career in IT. i got a job to work with kendo SpreadSheet where i need to fill the data from excel spread sheet to kendo SpreadSheet.

i search lot but found no similar code unfortunately.

I just found these two below links. https://demos.telerik.com/kendo-ui/spreadsheet/datasource https://demos.telerik.com/kendo-ui/spreadsheet/index

i like to go with this below code

 var dataSource = new kendo.data.DataSource({
                transport: {
                    read: onRead,
                    submit: onSubmit
                },
                batch: true,
                change: function() {
                   $("#cancel, #save").toggleClass("k-state-disabled", !this.hasChanges());
                },

I have few questions.

1) what is this url for var crudServiceBaseUrl = "https://demos.telerik.com/kendo-ui/service"; in code ?

2) i can not mention fields name in code because at runtime i may read any excel file whose fields may differ in number and name.

schema: {
                    model: {
                        id: "ProductID",
                        fields: {
                            ProductID: { type: "number" },
                            ProductName: { type: "string" },
                            UnitPrice: { type: "number" },
                            Discontinued: { type: "boolean" },
                            UnitsInStock: { type: "number" }
                        }
                    }
                }

3) i can not mention columns and rows like below fashion because which is not fixed in my case.

 $("#spreadsheet").kendoSpreadsheet({
                columns: 20,
                rows: 100,
                toolbar: false,
                sheetsbar: false,

so my request that if possible please guide me with sample code from asp.net mvc action i will read excel sheet data and send that data as a json to client side and kendo spreadsheet will bind and show. please guide me with sample code.

also mentions what js and css files i will add in my project?

thanks

Upvotes: 1

Views: 1257

Answers (0)

Related Questions