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?
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
How to display the "File(s) saved successfully in the Custom Kendo Upload Template.
Using the template below:
<span class='k-progress'></span>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!@
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?
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.
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)
)
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