Telerik Forums
UI for ASP.NET Core Forum
0 answers
219 views

Just got the Trial version this morning and when I added services.AddKendo() to configureservices I get the following error:

System.AggregateException: 'Some services are not able to be constructed 
  (Error while validating the service descriptor 'ServiceType: Kendo.Mvc.Rendering.IKendoHtmlGenerator 
   Lifetime: Transient ImplementationType: Kendo.Mvc.Rendering.KendoHtmlGenerator': 
             Could not load type 'Microsoft.AspNetCore.Mvc.Internal.ClientValidatorCache' 
   from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.)'

InvalidOperationException: Error while validating the service descriptor 'ServiceType: Kendo.Mvc.Rendering.IKendoHtmlGenerator 
Lifetime: Transient ImplementationType: Kendo.Mvc.Rendering.KendoHtmlGenerator': 
          Could not load type 'Microsoft.AspNetCore.Mvc.Internal.ClientValidatorCache' 
from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

 

I have MSDE 2019 Community and my solution/project is set up as an ASP.Net Core 3.1 MVC application

Alan
Top achievements
Rank 1
 asked on 23 Jun 2022
1 answer
122 views

I am using Telerik UI for ASP.NET Core

I have a hierarchical grid with nested child grids where the name is based off the parent grid record ("#gridValue_#=CODE_TABLE_ID#"). Is there an example where only the nested grids are drag and drop sortable and only within the same nested grid? I am not trying to move rows between different nested grids.

Thanks in advance

Mihaela
Telerik team
 answered on 23 Jun 2022
1 answer
99 views

Hi,

I have a dropdown list (ASP.NET Core v2021.2.511) that I have enabled filtering on using a contains filter. The list is bound but contains only a small number of rows, therefore Server filtering seemed to be overkill.

What is happening is this:

GLCode: H120

Description: Tuition Direct - Running Expenses

Templated text: Tuition Direct - Running Expenses (H120)

Search Text Examples:

  • H120 - no results found
  • tuit - item found

From this is appears that with client filtering that only the text in the DataTextField and not the result of the templated value is searched.

Is this by design or is it a bug ?

Shared View Code:

@model GeneralLedgerAccounts

@(Html.Kendo().DropDownListFor(m => m)
            .DataValueField("GLCode")
            .DataTextField("Description")
            .OptionLabel("Choose a GL Code ...")
            .Filter(FilterType.Contains)
            .BindTo((System.Collections.IEnumerable)ViewData["BudgetGLCodes"])
            .Template("#: data.Description # (#: data.GLCode #)")
)

Many Thanks

Chris

Alexander
Telerik team
 answered on 22 Jun 2022
1 answer
227 views

I have a user requirement to plot a chart as shown in the attached image (VerticalLine.JPG).

@(Html.Kendo().Chart<MyProject.WebAPI.MyChart.MyModel()>()
                    .Name("statistics")
                    .Title("User Interaction (Days)")
                    .Legend(legend => legend
                    .Position(ChartLegendPosition.Top)
                    )
                    .DataSource(ds => ds.Read(read => read.Url("/api/GetUserStats").Type(HttpVerbs.Get)))
                    .Series(series =>
                    {
                        series.Column(model => model.UserCount).Name("Total").Gap(.2).Color("#4169e1");
                    })
                    .CategoryAxis(axis => axis
                        .Categories(a => a.UserScore)
                        .Title("Days")
                    )
                    .ValueAxis(axis => axis.Numeric()
                        .Labels(labels => labels.Format("{0:N0}"))
                        .MajorUnit(1)
                    )
                    .AxisDefaults(a => a
                        .Labels(l => l.Font("12px Verdana"))
                    )
                    .Tooltip(tooltip => tooltip
                    .Visible(true)
                    .Shared(true)
                    .Format("{0:N0}")
                    )
                    .Zoomable(zoomable => zoomable
                    .Mousewheel(mousewheel => mousewheel.Lock(ChartAxisLock.Y))
                    .Selection(selection => selection.Lock(ChartAxisLock.Y))
                    )
                    )

 

namespace MyProject.WebAPI.MyChart
{
    public class MyModel
    {       
        public int UserCount { get; set; }

        public int UserScore { get; set; }

        public int UserGoal { get; set; }
    }
}

ResponseFromWebApi GetUserStats:

[{"UserCount":33,"UserScore":0,"UserGoal":7},{"UserCount":46,"UserScore":1,"UserGoal":7},
{"UserCount":46,"UserScore":2,"UserGoal":7},{"UserCount":32,"UserScore":3,"UserGoal":7},{"UserCount":29,"UserScore":4,"UserGoal":7},{"UserCount":40,"UserScore":5,"UserGoal":7},{"UserCount":45,"UserScore":6,"UserGoal":7},{"UserCount":54,"UserScore":7,"UserGoal":7},{"UserCount":42,"UserScore":8,"UserGoal":7},{"UserCount":31,"UserScore":9,"UserGoal":7},{"UserCount":22,"UserScore":10,"UserGoal":7},{"UserCount":29,"UserScore":11,"UserGoal":7},{"UserCount":25,"UserScore":12,"UserGoal":7},{"UserCount":35,"UserScore":13,"UserGoal":7},{"UserCount":42,"UserScore":14,"UserGoal":7},{"UserCount":28,"UserScore":15,"UserGoal":7},{"UserCount":13,"UserScore":16,"UserGoal":7},{"UserCount":12,"UserScore":17,"UserGoal":7},{"UserCount":10,"UserScore":18,"UserGoal":7},{"UserCount":16,"UserScore":19,"UserGoal":7},{"UserCount":23,"UserScore":20,"UserGoal":7},{"UserCount":24,"UserScore":21,"UserGoal":7},{"UserCount":20,"UserScore":22,"UserGoal":7},{"UserCount":12,"UserScore":23,"UserGoal":7},{"UserCount":17,"UserScore":24,"UserGoal":7},{"UserCount":4,"UserScore":25,"UserGoal":7},{"UserCount":14,"UserScore":26,"UserGoal":7},{"UserCount":5,"UserScore":27,"UserGoal":7},{"UserCount":20,"UserScore":28,"UserGoal":7},{"UserCount":16,"UserScore":29,"UserGoal":7},{"UserCount":16,"UserScore":30,"UserGoal":7},{"UserCount":3,"UserScore":31,"UserGoal":7},{"UserCount":7,"UserScore":32,"UserGoal":7},{"UserCount":10,"UserScore":33,"UserGoal":7},{"UserCount":5,"UserScore":34,"UserGoal":7},{"UserCount":14,"UserScore":35,"UserGoal":7},{"UserCount":9,"UserScore":36,"UserGoal":7},{"UserCount":4,"UserScore":37,"UserGoal":7},{"UserCount":3,"UserScore":39,"UserGoal":7},{"UserCount":7,"UserScore":40,"UserGoal":7}]

 

The vertical line should be plotted at the value of UserGoal which always will be the same number for all rows, like 7 in above exampe. I tried using PlotBand with hardcoded value (just for testing) but it doesn't plot at value 7. It probably plots at 7th position. If I use Vertical Chart, it plots from position 0 to 7, a diagonal line.

I can get the value of UserGoal via JQuery instead of getting through WebApi but how can I draw the vertical line on existing graph ?

  
Aleksandar
Telerik team
 answered on 22 Jun 2022
1 answer
232 views

Hi,

Is it possible to set the height of the combobox dropdown in JavaScript.

I can set it in the taghelper but I have the combobox beside another element on the page and I want to match the heights.

It seems to be that I should be able to set it in the open event for the combobox but I can't seem to get it to work.

Is there a property on the Combobox that I should change?

Changing the height on the data-role div seems to get overwritten.

Any suggestions?

Thanks,

Charlotte

 

Aleksandar
Telerik team
 answered on 21 Jun 2022
1 answer
594 views

Hello,

I am stuck behind a corporate network that does not allow me to connect to the telerik nuget feed. How can I install without NuGet? I looked at the MSI installer instructions but it seemed like that installed a nuget package file to use nuget for the install as well. We just need to be able to download the necessary files and add them as references in our project. Not sure which files need to be included etc.

Thanks in advance!

Aleksandar
Telerik team
 answered on 21 Jun 2022
1 answer
271 views

Boa tarde.

Eu instalei a versão mais recente do KendoUICore para .netcore 3.1, e continua a dar este erro:

System.AggregateException
  HResult=0x80131500
  Message=Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Kendo.Mvc.Rendering.IKendoHtmlGenerator Lifetime: Transient ImplementationType: Kendo.Mvc.Rendering.KendoHtmlGenerator': Could not load type 'Microsoft.AspNetCore.Mvc.Internal.ClientValidatorCache' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=3.1.25.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.)
  Source=Microsoft.Extensions.DependencyInjection
  StackTrace:
   at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable`1 serviceDescriptors, ServiceProviderOptions options)
   at Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(IServiceCollection services, ServiceProviderOptions options)
   at Microsoft.Extensions.DependencyInjection.DefaultServiceProviderFactory.CreateServiceProvider(IServiceCollection containerBuilder)
   at Microsoft.Extensions.Hosting.Internal.ServiceFactoryAdapter`1.CreateServiceProvider(Object containerBuilder)
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at WebApplication2.Program.Main(String[] args) in C:\Users\Pedro.q.Magalhaes\source\repos\WebApplication2\WebApplication2\Program.cs:line 17

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
InvalidOperationException: Error while validating the service descriptor 'ServiceType: Kendo.Mvc.Rendering.IKendoHtmlGenerator Lifetime: Transient ImplementationType: Kendo.Mvc.Rendering.KendoHtmlGenerator': Could not load type 'Microsoft.AspNetCore.Mvc.Internal.ClientValidatorCache' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=3.1.25.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

Inner Exception 2:
TypeLoadException: Could not load type 'Microsoft.AspNetCore.Mvc.Internal.ClientValidatorCache' from assembly 'Microsoft.AspNetCore.Mvc.Core, Version=3.1.25.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.


Alexander
Telerik team
 answered on 14 Jun 2022
1 answer
607 views

I have an ajax post method where the user will sign up for an open slot. After the slot gets assigned, I want to disable the button and change the text. Can anyone tell me what I'm doing wrong here. I'm coming from Web Forms to MVC so it's been a little learning curve.

 

here's my grid

@(Html.Kendo().Grid(Model)
                .Name("Grid")
                .Columns(columns =>
                {
                    columns.Bound(p => p.Id).Hidden(true);
                    columns.Bound(p => p.JobStartDateTime).Visible(false);
                    columns.Bound(p => p.JobInfo).Title("Job");
                    columns.Bound(p => p.JobTimes).Title("Times");
                    columns.Bound(p => p.JobPayDisplay).Title("Pay");
                    columns.Command(cmd => cmd.Custom("Details").Click("Details"));
                    columns.Command(cmd => cmd.Custom("Sign Up").Click("SignUp"));


                })
                .Pageable()
                .Scrollable(scr => scr.Height(500))
                        .DataSource(dataSource => dataSource
                            .Ajax()
                            .PageSize(20)
                            .ServerOperation(false)
                        )
                )

and then here's the javascript function

 


function SignUp(e) {
        var id = $(e.currentTarget).closest("tr").find('td:first').html();
        $.ajax({
            type: 'POST',
            url: '/Jobs/SignUp',
            data: {id : id},
            headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
            contentType: 'application/x-www-form-urlencoded; charset=UTF-8', 
            success: function (result) {
                alert(result);
                $(this).find(".k-grid-SignUp").addClass("k-state-disabled");
                $(this).find(".k-grid-SignUp").text("Awarded");
            },
            error: function () {
                alert('Failed  ' + result);
                
            }
        })
    }

Petar
Telerik team
 answered on 13 Jun 2022
1 answer
940 views
I have a combobox separate from my grid and I want to use the comboBox selected value to filter the grid results.  Do I need to do this in Java script? What is the best way to do this?
   @(Html.Kendo().ComboBox()
                .Name("comboBox")
                .Size(ComponentSize.Small)
                .DataTextField("Text")
                .DataValueField("Value")
                .Filter(DateTime.Today.Year.ToString())
                .HtmlAttributes(new { style = "width:100%;" })
                .BindTo(new List<SelectListItem>()
                {
                    new SelectListItem() {
                        Text = "2018", Value = "2018"
                    },
                    new SelectListItem() {
                        Text = "2019", Value = "2019"
                    },
                    new SelectListItem() {
                        Text = "2020", Value = "2020"
                    },
                      new SelectListItem() {
                        Text = "2021", Value = "2021"
                    },
                      new SelectListItem() {
                        Text = "2022", Value = "2022"
                    },
                      new SelectListItem() {
                        Text = "2023", Value = "2023"
                    },
                      new SelectListItem() {
                        Text = "2024", Value = "2024"
                    }
                })
         )

@(Html.Kendo().Grid<Golf.DataAccess.Models.GoodGolfSchool>()
    .Name("grid")
    .Filterable()
    .Columns(columns => {
        columns.Bound(pkey => pkey.Id).Hidden(true);
        columns.Bound(c => c.FirstName).Filterable(false);
        columns.Bound(c => c.LastName);
        columns.Bound(c => c.Email);
        columns.Bound(c => c.VillageId).Width(100);
        columns.Bound(c => c.ClassDateView).ClientTemplate("#=ClassDateView#")
               .Filterable(f => f.Multi(true).CheckAll(false));
        columns.Bound(c => c.Phone);
        columns.Bound(c => c.EntryDate).Hidden();
        columns.Command(cmd =>
        {
            cmd.Edit();
            cmd.Destroy();
        });
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .ServerOperation(true)
        .Read(read => read.Action("GolfSchoolRoster_Read", "GoodGolfSchools"))
        .Update(update => update.Action("Student_Edit", "GoodGolfSchools"))
        .Destroy(delete => delete.Action("Student_Distroy", "GoodGolfSchools"))
        .Model(model =>
        {
            model.Id(p => p.Id);
            model.Field(p => p.Id).Editable(false);
            model.Field(p => p.EntryDate).Editable(false);
            model.Field(p => p.ClassDateView).DefaultValue(
                ViewData["ScheduleDates"] as Golf.DataAccess.Models.ClassDateViewModel);
        })
        .Filter(filters => {
            filters.Add(model => model.ClassDate.Year).IsEqualTo([SELECTED VALUE FROM COMBOBOX ABOVE] );
        })
    )
    .ToolBar(tools =>
    {
        tools.Excel().Text("Export To Excel");
    })
    .Excel(excel =>
    {
        excel.FileName("GoodGolfSchool.xlsx");
        excel.AllPages(true);
       
    })
    .Pageable()
    .Sortable()
    .AutoBind(true)
    .Editable(edit => edit.Mode(GridEditMode.InLine))
)

Jay
Top achievements
Rank 1
Iron
Iron
 updated answer on 06 Jun 2022
1 answer
543 views

Hi Guys,

maybe i'm missing something, but could someone help me how i could define a ClientHeaderTemplate / HeaderTemplate for a Grid Column with the TagHelper?

<columns>
   <column field="Alert" title="" ***/>
</columns>

Thanks for your help!

Best wishes
Patrick

Alexander
Telerik team
 answered on 03 Jun 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?