Telerik Forums
UI for ASP.NET Core Forum
1 answer
9 views

    We are using telerik.web.ui  (version 2010.2.713.35 ) controls for displaying results in data grid format in our ASP.Net web application .

We have a new requirement to show the signature image in result grid for each record. Currently we store the signature image as base64 format in our database .we are able to convert base 64 to memory stream.

  We want to understand does any of your image control support to bind image from memory stream instead of Url.please refer below png file for reference.


 

 

Mihaela
Telerik team
 answered on 04 Jun 2021
1 answer
6 views

Hello,

I am trying to have a groupable Kendo grid with help of your demo.

https://demos.telerik.com/aspnet-core/grid/grouppaging

My question is, is there a way to implement it with custom data binding and not ajax data binding? when I try to do that, there's an error saying that GroupPaging() cannot be resolved.

 

Thank you in advance.

Mihaela
Telerik team
 answered on 03 Jun 2021
1 answer
10 views

In the Ajax control, you have the ability to filter a list and, if the term is not found, execute a command on the new term you typed in. This is in the Ajax demo at https://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/autocompleteclientside/defaultcs.aspx?_ga=2.149674102.1173080875.1622059656-840544784.1585530237 in the Autocomplete example at the top. I am not seeing this functionality replicated in the documentation for .NET Core. Is it possible to do something like this using a Tag Helper? If so, how would one go about it?

Thanks!

Laurie

p.s. For example, if I enter antoine@telerik.com (not found in the list), and click Submit, the message "You have selected the following email: antoine@teleri.com" will be displayed.

Stoyan
Telerik team
 answered on 02 Jun 2021
1 answer
9 views

Hi eveyone,

How can i remove the Form Clear Button?

Thanks

Petar
Telerik team
 answered on 02 Jun 2021
1 answer
10 views
I have attached the error, using the kendo tooltip error, and a sample of my code as well.
Petar
Telerik team
 answered on 02 Jun 2021
1 answer
25 views

I need to pass parameter with grid to controller just i want to pass  

BusId , FlightId , griddata to controller 

 

this funtion send only griddata  i want to add BusId , FlightId to save it in one table

   function SaveData(e) {

        var List = []

        BusId: $("#BusId").val() form DropdownList (1) cascadeDrop

       FlightId: $("#Flights").val()  form DropdownList (2) cascadeDrop

       var griddata = $("#Grid").data("kendoGrid"); From Selected Grid

        var rows = griddata.select(); which i selected form grid
        rows.each(function (e) {
            var dataItem = griddata.dataItem(this);
            List.push(dataItem);
        });
       
           $.ajax({
                 type: "POST",
                 url: "@Url.Action("Create", "Employee")",
                 dataType: "text",
                 data: JSON.stringify(List),
                 contentType: "application/json; charset=utf-8",
                 processData: false,

               success: function (data) {

               },

               error: function (e) {

}

   viewModel

   public class EmpViewModel
    {
        public int BusId{ get; set; }

        public int FlightId{ get; set; }

       public List<Employee>AllEmployee{ get; set; }
    }

 

Controller

public IActionResult Create([FromBody] IEnumerable<Employee> empList)
        {

        }

                                                                  
Stoyan
Telerik team
 answered on 01 Jun 2021
1 answer
14 views

Hello,

I saw an example by you guys for razor pages but I need it done for CRUD operations for a data source in the sql server. Assume I have appsettings.json file setup with the correct sql server connection string along with ApplicationDBContext setup in the startup.cs file in the configureservices section to allow dependency injection and the ApplicationDBContext was passed through a constructor for the specified model referenced in the code below to utilize dependency injection. What else would I need to change in the code to allow me to do CRUD operations on razor pages that utilizes entity framework core sql server as its data source?


@page
@model Telerik.Examples.RazorPages.Pages.Grid.GridCrudOperationsModel
@{
    ViewData["Title"] = "GridCrudOperations";
}

<h1>GridCrudOperations</h1>

@using Telerik.Examples.RazorPages.Models
@using Kendo.Mvc.UI

@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf
@Html.AntiForgeryToken()

@(Html.Kendo().Grid<OrderViewModel>().Name("grid")
                .Groupable()
                .Sortable()
                .Editable()
                .Scrollable()
                .ToolBar(x => {
                    x.Create();
                    x.Excel();
                })
                .Columns(columns =>
                {
                    columns.Bound(column => column.Freight);
                    columns.Bound(column => column.ShipName);
                    columns.Bound(column => column.ShipCity);
                    columns.Command(column =>
                    {
                        column.Edit();
                        column.Destroy();
                    });
                })
                 .Excel(excel => excel
                            .FileName("Export.xlsx")
                            .Filterable(true)
                            .ProxyURL("/Grid/GridCrudOperations?handler=Save")
                        )
                .DataSource(ds => ds.Ajax()
                       .Read(r => r.Url("/Grid/GridCrudOperations?handler=Read").Data("forgeryToken"))
                       .Update(u => u.Url("/Grid/GridCrudOperations?handler=Update").Data("forgeryToken"))
                       .Create(c => c.Url("/Grid/GridCrudOperations?handler=Create").Data("forgeryToken"))
                       .Destroy(d => d.Url("/Grid/GridCrudOperations?handler=Destroy").Data("forgeryToken"))
                       .Model(m => m.Id(id => id.OrderID))
                    .PageSize(10)
                )
                .Pageable()
)

<script>
    function forgeryToken() {
        return kendo.antiForgeryTokens();
    }
</script>

 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Telerik.Examples.RazorPages.Models;
using Kendo.Mvc.Extensions;
using Kendo.Mvc.UI;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace Telerik.Examples.RazorPages.Pages.Grid
{
    public class GridCrudOperationsModel : PageModel
    {
        public static IList<OrderViewModel> orders;

        public void OnGet()
        {
            if (orders == null)
            {
                orders = new List<OrderViewModel>();

                Enumerable.Range(0, 50).ToList().ForEach(i => orders.Add(new OrderViewModel
                {
                    OrderID = i + 1,
                    Freight = i * 10,
                    ShipName = "ShipName " + i,
                    ShipCity = "ShipCity " + i
                }));

            }
        }

        public JsonResult OnPostRead([DataSourceRequest] DataSourceRequest request)
        {
            return new JsonResult(orders.ToDataSourceResult(request));
        }

        public JsonResult OnPostCreate([DataSourceRequest] DataSourceRequest request, OrderViewModel order)
        {
            order.OrderID = orders.Count + 2;
            orders.Add(order);

            return new JsonResult(new[] { order }.ToDataSourceResult(request, ModelState));
        }

        public JsonResult OnPostUpdate([DataSourceRequest] DataSourceRequest request, OrderViewModel order)
        {
            orders.Where(x => x.OrderID == order.OrderID).Select(x => order);

            return new JsonResult(new[] { order }.ToDataSourceResult(request, ModelState));
        }

        public JsonResult OnPostDestroy([DataSourceRequest] DataSourceRequest request, OrderViewModel order)
        {
            orders.Remove(orders.FirstOrDefault(x => x.OrderID == order.OrderID));

            return new JsonResult(new[] { order }.ToDataSourceResult(request, ModelState));
        }

        [HttpPost]
        public ActionResult OnPostSave(string contentType, string base64, string fileName)
        {
            var fileContents = Convert.FromBase64String(base64);

            return File(fileContents, contentType, fileName);
        }
    }
}

 

Aleksandar
Telerik team
 answered on 31 May 2021
1 answer
27 views

Hi,

We have a system with Github Actions where we build our project whilst adding the telerik nuget repository.

And then it fails with a 500 error, it works sometimes, but not always.

    steps:
    - name: Checkout ${{ github.GITHUB_REF }}
      uses: actions/checkout@v2

    - name: Setup .NET Core
       uses: actions/setup-dotnet@v1
       with:
        dotnet-version: "5.0.x"
        
    - name: Setup Node.js environment
       uses: actions/setup-node@v2.1.2

    - name: Register Nuget Packages
       env: # Or as an environment variable
        telerik_username: ${{ secrets.telerik_username }}
        telerik_password: ${{ secrets.telerik_password }}
       run: dotnet nuget add source https://nuget.telerik.com/nuget --name telerik.com --username "$telerik_username" --store-password-in-clear-text --password "$telerik_password"

    - name: Install dependencies
       run: dotnet restore Project
2021-05-25T09:07:14.2001354Z   Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core'&semVerLevel=2.0.0'.
2021-05-25T09:07:14.2008435Z   Response status code does not indicate success: 500 (Internal Server Error).
2021-05-25T09:07:14.2014387Z   Retrying 'FindPackagesByIdAsyncCore' for source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core'&semVerLevel=2.0.0'.
2021-05-25T09:07:14.2036427Z   Response status code does not indicate success: 500 (Internal Server Error).
2021-05-25T09:07:14.2081008Z /home/runner/.dotnet/sdk/5.0.203/NuGet.targets(131,5): error : Failed to retrieve information about 'Telerik.UI.for.AspNet.Core' from remote source 'https://nuget.telerik.com/nuget/FindPackagesById()?id='Telerik.UI.for.AspNet.Core'&semVerLevel=2.0.0'. [/home/runner/work/(project...)]
Tsvetomir
Telerik team
 answered on 28 May 2021
1 answer
11 views
Why the AdditionalFields are not passed along in the validation when InCell mode? SO question here
Mihaela
Telerik team
 answered on 27 May 2021
1 answer
24 views

I have a simple grid setup with the datasource is returning a list.

  <kendo-grid name="grid" height="550">
      <datasource type="DataSourceTagHelperType.WebApi" page-size="5">
          <transport>
               <read url="@Url.Action("GetSchedule", "Home")" />
          </transport>
      </datasource>
      <columns>
           <column field="SalesRepName" title="Sales Agent" />               
           <column field="Shift" title="Shift" />
           <column field="Phone" title="Phone" />
      </columns>
 </kendo-grid>

  public ActionResult GetSchedule([DataSourceRequest] DataSourceRequest request)
        {
            // get scheduled sales rep.
            var result = _idb.RetrieveCurrentSchedule("LSL", "NH");

            var dsResult = result.ToDataSourceResult(request);

            return Json(dsResult);

        }
bundle.js:1 Uncaught TypeError: Cannot read property 'slice' of undefined

 

Mihaela
Telerik team
 answered on 26 May 2021