Telerik Forums
UI for ASP.NET MVC Forum
3 answers
66 views

I just updated the Kendo Spreadsheet components to the latest release and am now having a weird problem when data is posted back to the server, the row order changes.

I have a simple controller method that loads a file and returns data back to the client as a spreadsheet (it's doing some server-side validations but that's irrelevant to the problem).

Then client side I send the data back to the server.  In the past this has worked great.  Now, however, Rows 0 and 1 swap positions.

The only difference between the data coming back with the new component vs. the old is a height attribute.  Aside from that everything else is the same.

Controller Method

public ActionResult LoadFile(HttpPostedFileBase file)
{
    var workbook = Workbook.Load(file.InputStream, Path.GetExtension(file.FileName));
    //workbook = KendoExcelLoader.ProcessWorkbook<MyObject>(workbook, ApplyRules);
    return Content(workbook.ToJson(), MimeTypes.JSON);
}

Client Side (this is where rows 0 and 1 swap positions):

function saveData() {
    kendo.ui.progress($("body"), true);
    var sheetData = $("#spreadsheet").data("kendoSpreadsheet").sheets()[0];
 
    $.ajax({
        type: "POST",
        url: "/import/SaveData",
        data: {records: JSON.stringify(sheetData.toJSON())},
        success: function (data) {
            kendo.ui.progress($("body"), false);
 
        }
    });
}
Martin
Telerik team
 answered on 08 Oct 2019
1 answer
276 views

Hi there,

I’ve created some modules to export some info to Excel XLSX format using the classes Workbook and Worksheet from Telerik.Web.Spreadsheet.

So far so good, but now I need to setup the page (paper size and margins) for some Worksheets but I don’t see any method or property about this functionality in Telerik.Web.Spreadsheet.

Searching the web, I’ve realized that there’s another API in the assembly Telerik.Windows.Documents.Spreadsheet.dll. In fact, this link shows the features I need
https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/features/worksheetpagesetup

Right now I’ve a lot of code written in my exporters to Excel using the API in the Telerik.Web.Spreadsheet.

Is it possible to setup the page using the Telerik.Web.Spreadsheet API?

If not what are my options?

Thank you.

Misho
Telerik team
 answered on 05 Jul 2019
2 answers
305 views

Hi there,

First let me state what we're trying to achieve.

We need to inject some values into a pre-defined spreadsheet with data already on it (basically a copy from a previous version).  I thought I could name specific cells using the "defineName" method on the spreadsheet to create named ranges (each one cell in size) and then later find those ranges to set the values.

However, I might be incorrect in what the named ranges are for, but I cannot find a way to find a named range and then set it's value.  Is there a way to do this, or some other way to give cells that can be anywhere some kind of "metadata" that I can use later to inject data?

Say for example we have data relating to countries, I'd want to generate the spreadsheet, give each country's cell a number and give the cell a range name of the country. I wouldn't necessarily know the exact cell number, because users could insert new rows/columns etc, but the range name would stay. Then later I'd be able to find the ranges by country name somehow and put different numbers in there.

Thanks.

Dawid
Top achievements
Rank 1
 answered on 03 Jun 2019
14 answers
927 views

Hi, I'm trying to use server-side wrappers of the UI Spreadsheet for ASP.NET MVC.  I've looked over the documentation and searched this forum, and I can't find the answer to this question:  is it possible to bind the spreadsheet data to a model passed to a view, in the same manner as it's done for the Grid control?  For example, like the below.

Thank you!

example below;

@(Html.Kendo().Grid(Model) //Bind the Grid to the Model property of the view.
          .Name("Grid")
          .Columns(columns =>
          {
              columns.Bound(p => p.ProductID);   //Create a column bound to the "ProductID" property
              columns.Bound(p => p.ProductName); //Create a column bound to the "ProductName" property
              columns.Bound(p => p.UnitPrice);   //Create a column bound to the "UnitPrice" property
              columns.Bound(p => p.UnitsInStock);//Create a column bound to the "UnitsInStock" property
          })
         .Pageable() //Enable paging.
    )

 

Veselin Tsvetanov
Telerik team
 answered on 23 Apr 2019
1 answer
47 views
Is there anyway at all to add an image to a cell? We need a logo in the header. If that is not possible if we import one from the server is there a way to keep the image in place that is already there?
Ivan Danchev
Telerik team
 answered on 12 Mar 2019
2 answers
416 views

When uploading a CSV file containing nordic characters such as Å,Ä,Ö the spreadsheet fails to accurately represent them. 

This also does not work in your demo https://demos.telerik.com/aspnet-mvc/spreadsheet/server-side-import-export when uploading a file that looks like this:

1.Id,Namn,Förslag,Åtgärd
2.0,Åsä Löåfv,Lorem ipsum,Lörem ipsåm

Row  #1 is the header of the CSV, Row #2 is example data. As you can see in your own demo, importing this file into the spreadsheet does not work, the ÅÄÖ characters get represented as ? which later breaks other stuff in my application (when parsing the spreadsheet). Any idea on how to maintain these characters?

 

aron
Top achievements
Rank 1
 answered on 01 Feb 2019
1 answer
186 views

Hello - I expect what I want to do is not supported. I that it he case, then I'll abandon this cool idea I have and not use the kendo spreadsheet.

I need a view-only mode that just shows the cells where they cannot be edited/modified. I need an admin-only mode where the entire spreadsheet control is functional.

For the view-only mode I tried the following, which does hide most of the stuff I don't want. But it requires more work to adjust heights and handle click events, at least. As it is when I do this various script errors are occurring when I click within the spreadsheet div:

    $(document).ready(function () {
        $('.k-spreadsheet-sheets-bar').hide();
        $('.k-tabstrip-wrapper').hide();
        $('.k-spreadsheet-action-bar').hide();
        $('.k-spreadsheet-scroller').hide();
        $('.k-spreadsheet-column-header').hide();
        $('.k-spreadsheet-row-header').hide();
    });

Marin Bratanov
Telerik team
 answered on 27 Nov 2018
1 answer
596 views

Hi support team

Our customer wants to display the content of a simple (i.e. one sheet, simple content, see sample image attached) excel on a ASP.NET MVC rendered page. Is there a way to configure the Spreadsheet component without any menues and additional functionality like editing, copy/paste, etc.? 

Or is there a smarter way to provide such "viewer-only" functionality, like loading the excel sheet and display its contet in a Grid component? 

Uploading the file is not an issue, we have implemented this already. My question is only about rendering/displaying the content of a excel sheet on a page.

Any advice is highly appreciated. 

Regards, Daniel 

Marin Bratanov
Telerik team
 answered on 12 Nov 2018
3 answers
261 views

Hi,

I'm using the Telerik spreadsheet with MVC wrappers to create an input form and am trying to create a validation error when a cell is empty. I've tried various things along the lines of the below. The obvious way to do this seems to be to set AllowNulls = false but this doesn't behave in the same way that other custom validation does, it immediately adds a red validation check to every null cell with the validation check applied and never triggers the message supplied in the MessageTemplate. If setting AllowNulls(true) then it seems like the custom validation rule doesn't trigger on empty cells, so it seems like I can use the custom validator to check for anything other than a cell being empty. 

cells.Add()
                          .Validation(validation => validation
                            .DataType("custom")
                            .From("LEN(B" + currentRowNo + ") > 0")
                            .AllowNulls(false)
                            .Type("reject")
                            .TitleTemplate("A Provider Name is Required")
                            .MessageTemplate("Please enter a Provider Name"));

 

Regards

Michael

Veselin Tsvetanov
Telerik team
 answered on 03 Oct 2018
2 answers
107 views

Hi,

I'm using the Telerik spreadsheet with the MVC wrappers and am trying to add a custom cell editor, (actually an auto complete) but similar to the custom color editor shown in the third example on the Kendo UI demos https://demos.telerik.com/kendo-ui/spreadsheet/custom-editors. However this example is missing from the MVC demos https://demos.telerik.com/aspnet-mvc/spreadsheet/custom-editors and there is no Editor method on the SpreadsheetSheetRowCellBuilder object.

This example https://docs.telerik.com/kendo-ui/knowledge-base/spreadsheet-open-autocomplete-editor-on-cell-click suggests a way that I could use the Select event to achieve the editor in a popup but I would like to add it in cell. 

I realize this won't be available out of the box with the MVC wrappers, but would be very grateful if you could suggest how I might create a workaround for it. 

Regards

Michael

 

 

Michael
Top achievements
Rank 1
 answered on 02 Oct 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?