Telerik Forums
UI for ASP.NET MVC Forum
0 answers
61 views

 

The following is traversal binding. The onDataBound method allows you to bind cells individually, similar to my following writing method of $("# spreadsheet"). data ("kendoPrepadsheet"). activeSheet(). range ("K3"). format ("yyyy MM dd");

 

zhe
Top achievements
Rank 1
Iron
Iron
 asked on 23 Mar 2023
0 answers
78 views
0

I use Kendo Spreadsheet widget with local data binding in MVC. How can I set the datasource to the spreadsheet to do create, update and delete operation?

I know this example,

https://demos.telerik.com/aspnet-mvc/spreadsheet/datasource

but ajax remote binding is not fine for me, because the excel file has a realy complex header with many merged cells. And remote data fills the first row which overwrite header files. So I use this example:

https://www.telerik.com/forums/loading-data-into-a-specific-row-in-kendo-spreadsheet

After using it data liested in the proper rows, but it's very slow.

So please give me some information to resolve this issue. A have to save modifications of the spreadsheet.

Here I list a simple example of how I bind the data:

ViewModel:

public int ID { get; set; }
    public int Name { get; set; }
    public string Status { get; set; }
}

Action in controller:

public ActionResult Index()
{
    List<ViewModel> model = service.GetData();
    return View(model);
}

View cshtml:

@model List<Namespace.Model.ViewModel>

@section body {

    @(Html.Kendo().Spreadsheet()
        .Columns(3)
        .Name("DataExcel")
        .HtmlAttributes(new { style = "width:auto; height: 770px;" })
        .Toolbar(false)
        .Sheetsbar(false)
        .Events(e => e
            .Select("Scripts.onSelect"))
        .Sheets(sheets =>
        {
            sheets.Add()
            .Name("DataSheet")
            .Columns(columns =>
            {
                // Megbízott neve és státusza + Tantárgy neve
                columns.Add().Width(50);
                columns.Add().Width(100);
                columns.Add().Width(100);
            }).Rows(rows =>
            {
                foreach (var dataRow in Model)
                {
                    rows.Add().Height(50).Cells(cells =>
                    {
                        // Megbízott státusza
                        cells.Add()
                            .Value(dataRow.ID)
                            .VerticalAlign(SpreadsheetVerticalAlign.Center)
                            .Color("black");

                        // Tantárgy neve
                        cells.Add()
                            .Value(dataRow.Name)
                            .VerticalAlign(SpreadsheetVerticalAlign.Center)
                            .Color("black");

                        // Órakeret
                        cells.Add()
                            .Value(dataRow.Status)
                            .VerticalAlign(SpreadsheetVerticalAlign.Center)
                            .Color("black")
                            .Bold(true);
                    }
                }
            });
        })
    )
}
Norbert
Top achievements
Rank 1
 asked on 02 Mar 2023
0 answers
103 views

Note that this is Workbook.sheets and not Spreadsheet, but I couldn't select a more relevant tag nor create my own.

I am having an issue merging cells that are in an existing sheet in a workbook. My attempt to use mergedCells after the sheet has been created has a roadblock, I can't seem to get the range name in string format as documented for the mergedCells option in Workbook.sheet:

mergedCells: ["A6:A8"]

I have the logic to determine which cells' indexes I want to merge, but only the indexes. I can't figure out a way to get the range in an Excel cell name. In the following example, ignoring how I got the index values, I can't merge the cells based on index where indexA is the column and indexB1 and indexB2 are rows.

let indexA = 0;

let indexB1 = 5;

let indexB2 = 7;

sheet.mergedCells = [[{indexA, indexB1},{indexA,indexB2}]]

I have attached a picture of the types of cells I want to merge, my loop first hits A6 through A8 and determines the indexes are to be merged because all the cells' values equal "Boat". Any help is appreciated, and I will try to provide more detail if needed, but it is difficult to provide much more because of the nature of the system I am on.

Thanks in advance.

Alden
Top achievements
Rank 1
 asked on 06 Feb 2023
0 answers
61 views

I replaced these JS references. If I use the 2022 version, if the submission fails, the page will always be loaded and can't be clicked. If I use the 2021.1.224 JS page, it won't always be loaded and can be used normally!

zhe
Top achievements
Rank 1
Iron
Iron
 asked on 08 Sep 2022
0 answers
70 views

When spreadsheet click Submit, the value of my cell is copied and pasted in. I can't get the value of data.updated in the background! How to solve this problem

zhe
Top achievements
Rank 1
Iron
Iron
 asked on 30 Aug 2022
0 answers
57 views

Can I translate the header generated in the first line into Chinese. Translation, urgentspreadsheet

zhe
Top achievements
Rank 1
Iron
Iron
 asked on 23 Aug 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?