Telerik Forums
UI for ASP.NET Core Forum
2 answers
101 views

Hi referring to the attached, What should I write to capture the old record &latest record ? 

1. On Button clicked on "Saved Changes" [Show in [1]]

2. On Clicked on "Button"  [Shown in [2]]

I have tried but i am still getting the old records but no avail .... perhaps some enlightenment will be great.. 

Stefan
Telerik team
 answered on 04 Aug 2017
5 answers
3.5K+ views
I am using the Kendo DateInput inside my razor views as below

 <span>Date of Birth</span>
    @(Html.Kendo().DateInput().Name("Patient.Dob").Format("dd-MMM-yyyy").Min(new DateTime(1900, 1, 1))
             .Max(DateTime.Today).Messages(m => m.Year("yyyy").Day("dd").Month("mmm")))
 
When the date of birth is not entered, the model state validation fails as it tries to validate the placeholder value - ("dd-MMM-yyyy")

How can i specify the placeholder, such that it does not do model state validation
Boyan Dimitrov
Telerik team
 answered on 03 Aug 2017
1 answer
618 views

When I try to  add event to a multiselect I get this error

cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type

 I have tried these to method to add event

@(Html.Kendo().MultiSelectFor(m => m.OmviserNavne)
                                    .Placeholder("Vælg omviser...")
                                    .BindTo(ViewBag.Omviser)
                                    .Events(e =>
                                    {
                                        e.Change("onOmviserChange")
                                    })
                                    .Deferred())

@(Html.Kendo().MultiSelectFor(m => m.OmviserNavne)
                                    .Placeholder("Vælg omviser...")
                                    .BindTo(ViewBag.Omviser)
                                    .Events(events => events.Change("onOmviserChange"))
                                    .Deferred())

Dimitar
Telerik team
 answered on 02 Aug 2017
7 answers
573 views

Hello, 

I'm trying to get a grid with a select option just like this example http://demos.telerik.com/aspnet-core/grid/checkbox-selection

My grid loads with all the proper data however the columns.Select().Width(50);  does not load any check boxes like the example does. 

Here is the code that I am using.  I will also attach a screen shot of what this produces. 

@(
    Html.Kendo()
        .Grid<PlanReviewItemViewModel>()
        .Name("linkFolderAttachmentPlanReviewItems")
        .Columns(col =>
        {
            col.Select().Width(50);
            col.Bound(p => p.MunicipalNumber);
        })
        .Sortable()
        .DataSource(ds =>
        {
            ds.Ajax()
                .Read(read =>
                {
                    read.Action("GetPlanReviewItems", "PlanReviewItemsApi", new { caid = "PLDG5" });
                });
        })
)

Preslav
Telerik team
 answered on 02 Aug 2017
1 answer
222 views

I have a grid with an editor template like so:

@model decimal?
@(Html.Kendo().DropDownList()
      .Name("VatRate")
      .DataValueField("DecimalValue")
      .DataTextField("Name")
      .BindTo((System.Collections.IEnumerable)ViewData["VatRates"])
      )

 

In my grid I have the column defined like so:

columns.Bound(p => p.VatRate).EditorTemplateName("DropDownListVatRates");

 

The VatRate property is defined like so:

public decimal VatRate { getset; }

 

What I would like is for select the appropriate VAT rate and for the DDL to pass the decimal value back to the cell (something like this http://www.screencast.com/t/V41xQlYWq )

But I can't figure out how to do it, any help would be appreciated?

 

Stefan
Telerik team
 answered on 01 Aug 2017
2 answers
388 views

Hi!
I obtain this error when I try to Grouping by a default field in my Grid.

"ArgumentException: Invalid property or field - 'description' for type: AggregateFunctionsGroup
Kendo.Mvc.Infrastructure.Implementation.Expressions.MemberAccessTokenExtensions.CreateMemberAccessExpression(IMemberAccessToken token, Expression instance)"

I've tried many combinations of options and none works.

        <div>
            @(Html.Kendo().Grid<Gap.Web.ViewModels.QuestionViewModel>(Model)
                                                .Name("Preguntas")
                                                .Columns(columns =>
                                                {
                                                    columns.Bound(p => p.Text).Width(200);
                                                    columns.Bound(p => p.description).Width(150);
                                                    columns.ForeignKey(p => p.DataTypeID, (System.Collections.IEnumerable)ViewData["DataTypeNameList"], "DataTypeID", "DataTypeName").Width(85);
                                                    columns.Bound(p => p.AnswerOptions).ClientTemplate("#=AnswerOptionTemplate(AnswerOptions)#").EditorTemplateName("AnswerOptionsEditor").Width(170);
                                                    columns.Bound(p => p.required).ClientTemplate(IsRequiredTemplate).HtmlAttributes(new { style = "text-align: center" }).Width(70);
                                                    columns.Command(command =>
                                                    {
                                                        command.Edit().Text("Editar")
                                                                      .UpdateText("Salvar")
                                                                      .CancelText("Cancelar");
                                                        command.Destroy().Text("Borrar");
                                                    }).Width(120);
                                                })
                                                .ToolBar(toolBar => toolBar.Create().Text("Añadir"))
                                                .Selectable()
                                                .Editable(editable => editable.Mode(GridEditMode.InLine))
                                                .Scrollable(s => s.Virtual(true).Height("100%;"))
                                                .Groupable(false)
                                                .HtmlAttributes(new { style = "height:500px;" })
                                                .DataSource(datasource => datasource
                                                    .Ajax()
                                                    .ServerOperation(false)
                                                    .PageSize(40)
                                                    .Model(model =>
                                                    {
                                                        model.Id(p => p.Id);
                                                        model.Field(p => p.description).DefaultValue("");
                                                        model.Field(p => p.Text);
                                                        model.Field(p => p.DataTypeID).DefaultValue(0);
                                                        model.Field(p => p.AnswerOptions).DefaultValue(new List<Gap.Web.ViewModels.AnswerOptionViewModel>()); ;
                                                        model.Field(p => p.required).DefaultValue(true);
                                                    })                                                    

[THIS DOES NOT WORK] =>     .Group(g => g.Add("description", typeof(String)))
                                                    .Create(update => update.Action("EditingInline_Create", "Admin"))
                                                    .Read(read => read.Action("EditingInline_Read", "Admin"))
                                                    .Update(update => update.Action("EditingInline_Update", "Admin"))
                                                    .Destroy(update => update.Action("EditingInline_Destroy", "Admin"))
                                                    )
                                                    .Events(events => events
                                                        .Save("onSave")
                                                        .Cancel("onCancel")
                                                        .Edit("selectRowOnEdit")
                                                    )
                                                   .Deferred()
            )
        </div>

Any advice please?!

 

Thanks in advantage!

 

R.Perucha

Raul
Top achievements
Rank 1
 answered on 27 Jul 2017
3 answers
225 views

I am using the Grid control on several different pages within my ASP.NET Core MVC app. All of a sudden on several of them I am running in to some weird issues. I am using Telerik.UI.for.AspNet.Core.Trial 2017.2.621

On page load everything works fine. If I do a POST to submit a search, which reloads the same exact page, I am getting weird server side exceptions. On some pages everything works just fine and the issue doesn't happen. I've compared the ones that work and don't work and can't find any real difference. I've also seen some weird exceptions about parsing strings to numbers.

 

      "exceptions": [
        {
          "id": 26884016,
          "typeName": "System.NullReferenceException",
          "message": "Object reference not set to an instance of an object.",
          "hasFullStack": true,
          "stack": "   at Kendo.Mvc.UI.DataSourceRequestModelBinder.TryGetValue[T](ModelMetadata modelMetadata, IValueProvider valueProvider, String modelName, String key, Action`1 action)\r\n   at Kendo.Mvc.UI.DataSourceRequestModelBinder.CreateDataSourceRequest(ModelMetadata modelMetadata, IValueProvider valueProvider, String modelName)\r\n   at Kendo.Mvc.UI.Grid`1.ProcessDataSource()\r\n   at Kendo.Mvc.UI.Grid`1.ProcessSettings()\r\n   at Kendo.Mvc.UI.WidgetBase.RenderHtml(TextWriter writer)\r\n   at Kendo.Mvc.UI.WidgetBase.ToHtmlString()\r\n   at Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.WriteTo(TextWriter writer, HtmlEncoder encoder)\r\n   at Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewBuffer.<WriteToAsync>d__22.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Mvc.Razor.RazorView.<RenderLayoutAsync>d__17.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Mvc.Razor.RazorView.<RenderAsync>d__13.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.<ExecuteAsync>d__18.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Mvc.ViewResult.<ExecuteResultAsync>d__26.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeResultAsync>d__30.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextResultFilterAsync>d__28.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ResultExecutedContext context)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextResourceFilter>d__22.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ResourceExecutedContext context)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeAsync>d__20.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Session.SessionMiddleware.<Invoke>d__9.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.AspNetCore.Session.SessionMiddleware.<Invoke>d__9.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at StackifyMiddleware.RequestTracerMiddleware.<Invoke>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.<Invoke>d__8.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Frame`1.<RequestProcessingAsync>d__2.MoveNext()"
        }
      ]

 

My razor code is simple like this:

@(Html.Kendo().Grid< GSCKeyword.GridRecord>(Model.Records)
      .Name("Grid")
      .Columns(columns =>
      {
          columns.Bound(p => p.Query).Title("Query");
          columns.Bound(p => p.Clicks).Title("Clicks").Format("{0:N0}");
          columns.Bound(p => p.Impressions).Title("Impressions").Format("{0:N0}");
          columns.Bound(p => p.CTR).Title("CTR").Format("{0:#0.#}%").Width(70);
          columns.Bound(p => p.Position).Title("Position").Format("{0:##0.#}").Width(70);
          columns.Bound(p => p.Page).Title("Top Page");
      })
      .Pageable()
      .Sortable()

      .DataSource(dataSource => dataSource
          .Ajax()
          .PageSize(500)
          .ServerOperation(false)
      )
)

 

Boyan Dimitrov
Telerik team
 answered on 26 Jul 2017
3 answers
130 views

Hello,

 

Could anybody tell me which version of Telerik.Web.UI.dll FIRST started to use new setting "Telerik.AsyncUpload.ConfigurationEncryptionKey" in the web.config file for extra security for file upload?

Which version was the first to introduce this setting?

 

Thanks

Marin Bratanov
Telerik team
 answered on 25 Jul 2017
4 answers
240 views

 

I am using the following simple TagHelper:

   <kendo-datepicker name="DatePicker"
                                  for="Date"
                                  style='width: 280px;'>
    </kendo-datepicker> 

It works correctly but compiles with the following warning:

Warning Element 'kendo-datepicker' does not allow content and cannot have separate end tag.

I cannot get rid of the warning, what does it mean and how do I get rid of it?

 

Reafidy
Top achievements
Rank 2
Iron
 answered on 25 Jul 2017
2 answers
350 views

Hi!

We are developing a Grid, and we require having an Editable ListBox in a Cell of a GRID.
I have search for this solution and try coding during a week without success.
My project is ASP.NET Core and MVC tech. I have tried with EditorTemplates and ClientDetailTemplateId without lucky.
Please, is this possible? Has the ListBox a SAVING action? and how can achieve this or similar?
The final requirement is having a Editable List of string items in the databound of the ViewModel.

Thanks in advance!

Raul
Top achievements
Rank 1
 answered on 24 Jul 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?