Telerik Forums
UI for ASP.NET MVC Forum
1 answer
14 views

Hello, I am trying to make a function that can resize my spreadsheet sheet dynamically based on the data, which is load on the sheet.

I know that the Spreadsheet has a function called "resize". I pass the numbers of columns and rows with a ViewBag, from the controller to the View on JS.

Controller:

public ActionResult Menus_Read([DataSourceRequest] DataSourceRequest request)
{
    try
    {
        List<MenuViewModel> menus = db.GetMenus();
        DataSourceResult result = menus.ToDataSourceResult(request);
        ViewBag.RowCount = menus.Count;
        ViewBag.ColumnCount = typeof(MenuViewModel).GetProperties().Length;
        
        return Json(result, JsonRequestBehavior.AllowGet);
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.ToString());

        ModelState.AddModelError(string.Empty, ex.Message);
        return Json(new[] { new object() }.ToDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet); ;
    }
}

 

JS:

    $(document).ready(function() {
        var rowCount = @(ViewBag.RowCount);
        var columnCount = @(ViewBag.ColumnCount);

        var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
        var sheet = spreadsheet.activeSheet();
        sheet.resize(rowCount, columnCount);
    });

To use the ViewBag content for the view I first need to get the data, to check the count of the columns and rows. Maybe this could be my problem, the timing.

Has anyone had a similar problem or can help me?

Mihaela
Telerik team
 answered on 01 Apr 2024
1 answer
20 views

I have a simple MVC Grid

with a column that looks like this

        columns.Bound(c => c.FirstName).Filterable(fi => fi.Cell(ce => ce.Operator("contains").SuggestionOperator(FilterType.Contains)));

the grid is just

        .Filterable()

Searching and GPT told me to do it this way, however when I filter that column I still only get the default filter of Equals

https://imgur.com/FewY7E0

Anton Mironov
Telerik team
 answered on 29 Mar 2024
1 answer
26 views

How to display the "File(s) saved successfully in the Custom Kendo Upload Template.

 

Using the template below:

<span class='k-progress'></span>
<div class='file-wrapper'>
    <span class='file-icon #=addExtensionClass(files[0].extension)#'></span>
    <div class='file-heading file-name-heading'>Name: #=name#</div>
    <div class='file-heading file-size-heading'>Size: #=kendo.toString(size/1024,"n2")# KB</div>
    <div class="file-heading file-error-heading">
    #if (files[0].error) { # <span class="k-file-validation-message"> #= files[0].error # </span> # } #
    </div>
</div>
Mihaela
Telerik team
 answered on 28 Mar 2024
4 answers
1.4K+ views
Hi Support,

I am using kendo drop down list in grid.
I am facing an issue on scroll of the page when the drop down was opened while edit/add in grid. (See attachment) 
When kendo ui drop down opened try to scroll with the mouse wheel, the kendo dropdown list is detaching from it and moving on the page with the scroll.

Is there any fix for this to make it close on scroll .
To produce the scenario :-  
1>  open the drop down list using mouse scroll wheel move the page up/down .
2> List also will move to up and down by detaching from the element

Any help much appreciated.
thanks in advance

Saroj
Lee
Top achievements
Rank 2
Bronze
Bronze
Bronze
 answered on 27 Mar 2024
1 answer
22 views

Hi

How do you enable tabbing on all elements in a Kendo Grid.   I have set  .Navigatable() - but doesn't seem to do anything.

I want the user to tab through the rows, including the page numbers  (items per page) and the filter boxes.

 

thx!@

Viktor Tachev
Telerik team
 answered on 22 Mar 2024
1 answer
39 views

I'm using Kendo v 2023.2.606 from the Kendo CDN.
In my view I have the following code:

<div class="row row-cols-lg-auto gx-3 gy-2 align-items-baseline mt-2">
    <div class="col">
        <h4>Choose File</h4>
        <!-- upload a file -->
        @(Html.Kendo().Upload()
            .Name("files")
            .Multiple(false)
            .ShowFileList(false)
            .Async(_ => _
                .Save("SubmitFile", "DataImport", new { Area = "Admin" })
                .Batch(true)
                .AutoUpload(true)
            )
            .Events(_ => _
                .Upload("onUpload")
                .Success("onUploadSuccess")
                .Error("onUploadFail")
            )
            .Validation(_ => _
                .AllowedExtensions(new string[] { "xls", "xlsx", "csv" })
                .MaxFileSize(3145728)
            )
        )
    </div>
</div>

If I select a file with an extension that is not listed, e.g. .zip, or I select a file that is more than 3.14MB all I see is this:

It does not hit my MVC controller action (which is fine) but the only indication of a problem is the (!) icon. The icon is not clickable.

Why is it not displaying a message saying the file is not valid/too big?

Ivan Danchev
Telerik team
 answered on 20 Mar 2024
1 answer
38 views

Is it possible to extend the Telerik MVC Grid toolbar to include custom commands? I'm looking to add my own functionality to the toolbar, and I'm wondering if there's a way to create a method within the toolbar command factory to generate buttons with specific functionality that I want to apply across all grids in my application.

For example, I have these three methods I have added using the toolbar template.


instead of using the template every time I would like to add custom command like save or excel.

Anton Mironov
Telerik team
 answered on 11 Mar 2024
1 answer
22 views

I've been working with the Kendo DatePicker UI component and I really like the masking and validation it provides if a user wants to manually enter a date when DateInput() is applied. However, it also adds segmentation which means a user either needs to click or use arrow keys to move on to edit other parts of the date like month, day or year. If I remove DateInput() there is no more segmentation, but also no validation or masking. Is there a way to keep validation and masking in the date input field without the segmentation and keep the date picker functionality? My other option is to remove .DateInput() along with the messages and manually apply validation and masking, but if there is a solution within the component itself, that would be ideal. Below is what we currently have.

                                                       @(Html.Kendo().DatePicker()
.Format(Model.DateMask)
.Name("DateStart")
.DateInput()
.Messages(m => m.DateInput(d => d.Day("__")))
.Messages(m => m.DateInput(d => d.Month("__")))
.Messages(m => m.DateInput(d => d.Year("____")))
.Culture(UICulture)
.Footer(false)
                          )

Anton Mironov
Telerik team
 answered on 05 Mar 2024
1 answer
28 views

Can we change the starting day of the week from Sunday to Monday? i.e. MO, TU, WE, TH, FR, SA, SU

Or Sunday to Saturday? i.e. SA, SU, MO, TU, WE, TH, FR

Instead of the current: SU, MO, TU, WE, TH, FR, SA

Mihaela
Telerik team
 answered on 28 Feb 2024
1 answer
15 views
Is it possible to make it so if a user clicks a day it selects the whole week, like clicking the week number does? Then is it also possible to capture multiple selected weeks (not necessarily concurrent weeks or in the same month), even if all the dates in those selected weeks are the output that would be fine
Ivan Danchev
Telerik team
 answered on 28 Feb 2024
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?