Telerik Forums
UI for ASP.NET Core Forum
5 answers
298 views
We need your feedback, because we are considering changes in the release approach for Telerik UI for ASP.NET Core. Please provide your feedback in the comments section below:


1. Is it hard to understand the version numbers of our releases? If yes, what makes them hard to understand them?

2. Would semantic versioning (SemVer) of our releases make it easier to understand our version numbers and what's behind them?

3. If we go with SemVer, we might need to start with version 3000.0.0 as we currently use 2022.x.x. Please share your thoughts about this approach and ideas for what number versioning would work best for you.

Chris
Top achievements
Rank 1
Iron
 answered on 05 Feb 2024
1 answer
332 views

Hi!

The ListView is breaking my web application, and I cannot make head or tail of the reason:

An unhandled exception occurred while processing the request.

NotSupportedException: "ClientTemplateId or ClientTemplateHandler" cannot be null or empty.

Kendo.Mvc.UI.ListView<T>.VerifySettings()

 

Also, you demos for the ListView are broken and the browser tab crashed after a while.

I need an urgent fix, as this is affecting the live application.

Aleksandar
Telerik team
 answered on 17 Mar 2023
0 answers
426 views

In our UI for ASP.NET Core R3 2020 (2020.3.915) release, the Column menu message of unsticking a column is "null".

This bug will be resolved in our next official release.

In the meantime, as a workaround, manually set the Unstick Column menu message:

.ColumnMenu(c => c.Messages(m => m.Unstick("Unstick Column")))
Kendo UI
Top achievements
Rank 1
 asked on 16 Sep 2020
1 answer
6 views

Here's my grid:

 

@(Html.Kendo().Grid<SalaryIncrease>()
    .Name("SalaryIncreaseGrid")
    .Columns(columns =>
    {
        columns.Command(command =>
                        {
                            command.Custom("Edit").Click("meVM.editSalaryIncrease");
                            command.Custom("Delete").Click("meVM.deleteSalaryIncrease");
                        }).Width(100);
        columns.Bound(p => p.FiscalYear).Title("Fiscal Year").Width(250);
        columns.Bound(p => p.SalaryIncreaseCategory.Name).Title("Salary Increase Category").Width(400);
        columns.Bound(p => p.CurrencyId).Title("Currency").Width(250);
        columns.Bound(p => p.IncreaseAmount).Title("Increase Amount").Width(500).Format("{0:###,##0.00}");
        columns.Bound(p => p.EffectiveDate).Title("Effective Date").Width(500).Format("{0:yyyy-MM-dd}");
    })
    .Pageable(pageable => pageable
    .Refresh(false)
    .PageSizes(new[] { 5, 10, 25, 50, 100 })
    .ButtonCount(6)
    )
    .Sortable()
    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
    .Resizable(resize => resize.Columns(true))
    .Scrollable()
    .ColumnMenu(menu => { menu.ComponentType("modern"); })
    .Events(e => e.DataBound("meVM.onSalaryIncreaseGridDataBound"))
    .DataSource(dataSource => dataSource
    .Ajax()
    .Batch(true)
    .PageSize(10)
    .Model(model => model.Id(p => p.Id))
    .ServerOperation(false)
    .Read(read => read.Url("/Employee/ManageEmployee?handler=SalaryIncrease_Read").Type(HttpVerbs.Get))))
What I want to do is pass the id specified in the `.Model` line to the javascript functions `meVM.editSalaryIncrease` and `meVM.deleteSalaryIncrease`. When I look at the documentation it always uses `this.dataItem($(e.currentTarget).closest("tr"))` to find the dataItem and get the Id. The problem is I have javascript classes acting as client-side view models. The functions on those view models are defined as arrow functions so that `this` points to the class and I can call private functions. But if I do that here, then `this` will not contain dataItem. All of this could be resolved if I could just call `meVM.editSalaryIncrease(Id)` to pass the parameter. How can I do this?
Legion
Top achievements
Rank 1
Iron
 answered on 09 May 2024
0 answers
2 views

Hello, I hope you are well.

I hope you can help me with this problem I have.

I am using the Kendo UI for JQuery Upload.

What I require is to upload an entire folder of TXT files, but I have a routine that validates that the name and content meet certain rules.

I apply these rules within the foreach loop (var file in files), because what is required is that if the file is valid it shows a text that it is valid, otherwise it shows a text that is not valid and for both options to continue processing the next file.

But by marking that file as erroneous, the controller is exited and the view is returned, thus leaving the processing of the rest of the files incomplete.

I share the code of the view and the controller, hoping you can give me some light.

View Code:

<div class="centered">
    @using Kendo.Mvc.UI
    <div>
        <div class="demo-section">
            @(Html.Kendo().Upload()
                .Name("files")
                .Async(a => a
                    .Save("ChunkSave", "Upload")
                    .Remove("Chunk_Upload_Remove", "Upload")
                    .AutoUpload(true)
                    .ChunkSize(11000)

                )
                .Multiple(true) // Enable multiple file selection
                    .Directory(true)
                    .DirectoryDrop(true)
                .Validation(validation =>
                {
                    //validation.MaxFileSize(20000000);
                })
                .Events(events =>
                {
                    events.Upload("onUpload");
                    events.Success("onUploadSuccess");
                    events.Error("onUploadError");
                    events.Select("onSelect");
                })
                .Messages(messages =>
                {
                    messages
                        .Select("Seleccionar archivos")
                        .DropFilesHere("Suelta archivos aquí para cargarlos")
                        .Remove("Eliminar")
                        .Retry("Reintentar")
                        .StatusFailed("Error")
                        .StatusUploaded("Terminado")
                        .StatusUploading("Cargando")
                        .UploadSelectedFiles("Cargar archivos")
                        .UploadFail("Error al procesar el archivo.")
                        .HeaderStatusUploaded("Terminado");
                })

            )
        </div>
    </div>
</div>

 

Controller Code:

public async Task<ActionResult> ChunkSave(IEnumerable<IFormFile> files, string metaData, string cve)
{

    int status = 0;
    DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(ChunkMetaData));


    MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(metaData));
    ChunkMetaData? somemetaData = serializer.ReadObject(ms) as ChunkMetaData;
    string path = String.Empty;

    if (files != null)
    {
        foreach (var file in files)
        {
            cap_dbt controller = new cap_dbt(_context);
            controller.ProcessFile(file, somemetaData.FileName, cve);
            status = controller.ProcessFile(file, somemetaData.FileName, cve);
            if (status == 1)
            {
                Upload(files, somemetaData.FileName);
            }
        }
    }


    if (somemetaData is null)
    {
        throw new Exception("No Metadata!");
    }

    Util.FileResult fileBlob = new Util.FileResult();
    fileBlob.uploaded = somemetaData.TotalChunks - 1 <= somemetaData.ChunkIndex;
    fileBlob.fileUid = somemetaData.UploadUid;
    fileBlob.warnings = Mensajes.msgLoadCsvWarning;
    fileBlob.message = "[" + somemetaData.FileName + "]\t";

    try
    {
        if (!fileBlob.uploaded)
        {
            fileBlob.message += "[ERROR]" + Mensajes.msgLoadCsvError;

            return StatusCode(500, fileBlob);
        }
        else if (status == -1)
        {
            fileBlob.uploaded = false;
            fileBlob.message += "[ERROR] " + Mensajes.msgLoadCsvError;
            throw new Exception(fileBlob.message); // <------- If I remove this line, it continues processing, but it no longer changes the file, it stays with the same name or empty.

        }

        if (fileBlob.warnings.Equals(""))
        {
            fileBlob.message += Mensajes.msgLoadCsvOk;
        }
    }

    catch (Exception ex)
    {
        Console.WriteLine(ex.ToString());
        return StatusCode(500, fileBlob);
    }
    finally
    {
        Mensajes.resetMsg();
    }

    return Json(fileBlob);
}

The following line was created to manipulate the Upload properties:
Util.FileResult fileBlob = new Util.FileResult();

I know what I can do if my file is not valid:
fileuid=""
success = false

But I see that if success is false it stops processing all the files and exits and goes to view.
SANDRO
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 08 May 2024
1 answer
8 views

Hello,

i want to bind data to an autocomplete async.
The index.cshtml looks like this:

@(Html.Kendo().AutoCompleteFor(m => m.customerName)
        .DataTextField("customerName")
        .BindTo((System.Collections.IEnumerable)ViewData["customers"])
    )

The controller like this:

 public async Task<IActionResult> Index()
 {
     InitializeApiClient();

     ViewData["customers"] =  await GetCustomers();

     return View();
 }

 private async Task<IEnumerable<CustomerShort>> GetCustomers()
 {
     Customers = new List<CustomerShort>();

     List<Models.Customer> customer = await JupiterClient.Api.V1.Customer.GetAsync(x => x.QueryParameters = null);
     foreach (var item in customer)
     {
         Customers.Add(new CustomerShort()
         {
             customerId = item.Id.ToString(),
             customerName = item.Name + @" (" + item.Id.ToString() + @")"
         });

         if (Customers.Count > 999)
         {
             break;
         }


     }

     return Customers.AsEnumerable();
 }

When i start the web-app i get no error. But the client-data is empty:
What have i made wrong?

Kind regards
Jens

Anton Mironov
Telerik team
 answered on 08 May 2024
1 answer
13 views

I have a Hierarchy Grid similar to https://demos.telerik.com/aspnet-core/grid/hierarchy

In my child Grid i have used a Client template to add an image which on click calls a JQuery Function. I am passing row from grid in my JQuery function. I can not use Grid function as i need to do some pre and post validation in JQuery before my Controller method is called.

How do i get the Grid Id for child grid to retrieve the row clicked in my JQuery function. 

For the Parent gris i am able to achieve this using:

var tr = $(ev).closet("tr");

var dataItem = $("parentGridName").data("kendoGrid").dataItem(tr);

But for child grid since name is created dynamically how do i retrieve the row clicked.

Mihaela
Telerik team
 answered on 07 May 2024
1 answer
12 views

I have a kendo grid with fields as below:

columns.Bound(p => p.FlightID).Visible(false);
columns.Bound(p => p.FlightDate).Format("{0:d}").Media("(min-width: 450px)");
columns.ForeignKey(p => p.AircraftID, @Model.Aircraft, "AircraftID", "Registration").Title("Aircraft").EditorTemplateName("ComboBox").Media("(min-width: 450px)");
... more columns
columns.Template("#=resColTemplate(data)#").Title("Record").Media("(max-width: 450px)");

And a responsive column template:

<script id="responsive-column-template" type="text/x-kendo-template">
    <p class="col-template-val"><strong>Date: </strong>#=kendo.toString(FlightDate, "dd/MM/yyyy")#</p>
    <p class="col-template-val"><strong>Registration: </strong>#=data.AircraftID#</p>
</script>
Razor PageModel:
public class IndexModel : PageModel
{
    public IndexModel(ApplicationDbContext context)
    {
        _context = context;
    }

   private readonly ApplicationDbContext _context;

   public IEnumerable<Models.Aircraft> Aircraft { get; set; }

   public IEnumerable<Models.Person> Person { get; set; }

   public IEnumerable<Models.Organisation> Organisation { get; set; }

   public async Task OnGet()
   {
       Aircraft = await _context.Aircraft.AsNoTracking().ToListAsync();
       Person = await _context.Person.AsNoTracking().ToListAsync();
       Organisation = await _context.Organisation.AsNoTracking().ToListAsync();
   }
   public async Task<IActionResult> OnPostRead([DataSourceRequest] DataSourceRequest request)
   {
       var flightLogs = await _context.FlightLog.AsNoTracking().ToList().ToDataSourceResultAsync(request);

       return new JsonResult(flightLogs);
   }
....

Instead of the AircraftID field, I would like to display Registration from the ForeignKey field.  Note the ForeignKey field is populated from another model.

Is that possible?

Mihaela
Telerik team
 answered on 01 May 2024
1 answer
9 views

I am trying to create a grid with 4 columns: Field, Operator, Value and a Delete button

The Field column is selectable from a drop down when editing and this I have done using a Action call.

The second column, Operator has a fixed set of operators like '>', '<', '>='. I was hoping to create this list right inside this grid definition. So I chose the overload: columns.ForeignKey(memberName, SelectList) and I have created a SelectList in the second argument. But it does not work and the Operator column is not showing a drop down:

@(
Html.Kendo().Grid<formFilter>()
	.Name("gridFilter")
	.ToolBar(toolbar =>
	{
		toolbar.Create().Text("Add");
		toolbar.Save().Text("Save").CancelText("Cancel");
	})
	.Editable(editable => editable.Mode(GridEditMode.InCell))
	.Columns(columns =>
	{
	columns.ForeignKey(c => c.filterName, ds => ds.Read(r => r.Action("fieldNames", "View1", new { className = "View1" })), "filterName", "filterName").Title("Field").Width(200);
	columns.ForeignKey(c => c.filterEval, new SelectList(
		new List<SelectListItem>
			{
				new SelectListItem { Text = ">", Value = ">"},
				new SelectListItem { Text = "<", Value = "<"},
				new SelectListItem { Text = ">=", Value = ">="},
			}, "Value", "Text"))
		.Title("Operator").Width(200);
	columns.Bound(c => c.filterValue).Title("Value");
	columns.Command(c => c.Destroy()).Width(50);
	})
	.Pageable(pageable => pageable
	.Refresh(true)
	.PageSizes(true))
	.DataSource(dataSource => dataSource
		.Ajax()
		.PageSize(5)
		.Batch(true)
		.ServerOperation(false)
		.Events(events => events.Error("ErrorHandlerForFilterTable"))
		.Model(model =>
		{
			model.Id(p => new { p.filterId });
		})
		.Create("createFilter", "View1")
		.Read(read => read.Action("getFiltersTable", "View1", new { url = @Context.Request.Path }))                                                                                
		.Update("updateFilter", "View1")
		.Destroy(del => del.Action("deleteFilter", "View1"))                                        
	)
)

Alexander
Telerik team
 answered on 30 Apr 2024
1 answer
13 views

Hello,

It is not clear from your documentation whether you are still relying on jszip.js for Excel exports.  We have found that this library has critical security vulnerabilities that have not been addressed by the FOSS developer who created it.

Please advise as to what you recommend.

 

Thanks.

Mihaela
Telerik team
 answered on 29 Apr 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?