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

I have a number List Boxes with a single context menu that is shared across them.

The context menu correctly displays when I right click the list box item but it doesn't seem to set the target value of the Select or Open events.

The menu configuration is:

@(Html.Kendo().ContextMenu()
        .Name("listbox_contextmenu")
        .Target("[role=listbox]")
        .Filter("[role=option]")
        .Orientation(ContextMenuOrientation.Vertical)
        .Animation(animation =>
        {
            animation.Open(open =>
            {
                open.Fade(FadeDirection.In);
                open.Duration(500);
            });
        })
        .Items(items =>
        {
            items.Add().Text("Escalate to Management");
            items.Add().Separator(true);
            items.Add().Text("Email Allocated User");
        })
        .Events(events =>
        {
            events.Open("contextMenuOpen").Select("contextMenuSelect");
        })
)

 

The java script function do nothing at the moment:

function contextMenuOpen(e) {
    alert('e.item is ' + JSON.stringify($(e.item)));
    alert('e.target is ' + JSON.stringify($(e.target)));
}
function contextMenuSelect(e) {
    alert('e.item is ' + JSON.stringify($(e.item)));
    alert('e.target is ' + JSON.stringify($(e.target)));
}

 

I'm hoping you can point out what I'm doing wrong here.

Many Thanks,

Rob

Neli
Telerik team
 answered on 20 Apr 2018
3 answers
150 views

I am trying to plan a way to negate the update process if the value the user has entered on a new record would be a duplicate.

This is in a custom editor on a popup so I could have an Ajax action when the user exits and/or changes the field value but I am not sure how to check if it is in edit or insert mode inside the custom editor.

Is there a suggested pattern to use here for this?

Thanks

Viktor Tachev
Telerik team
 answered on 19 Apr 2018
1 answer
3.1K+ views

Good day,

 

I have a question since all solutions I've found so far didn't work in my case. Hre's a brief description of what I have... So, I have my kendoGrid with all the info displayed. I'm trying to make a button for certain rows which will call a method in my Controller. Here's the code on my page:

@(Html.Kendo().Grid<DisplayEntitiesViewModel>()
              .Name("CustomersGrid")
              .Columns(columns =>
              {
                  columns.Bound(c => c.CustomerId).Hidden(true);
                  columns.Bound(c => c.CustomerName)
                      .Width(150);
                  columns.Bound(c => c.CustEmail)
                      .Width(800);
                  columns.Command(command => command
                      .Custom("Add Contact")
                      .Visible("showButton")
                      .Click("AddContact")).Width(180);
              })
              .HtmlAttributes(new {style = "height: 580px; width: 1133px; margin-left: 16px"})
              .Scrollable()
              .Groupable()
              .Sortable()
              .Pageable(pageable => pageable
                  .Refresh(true)
                  .PageSizes(true)
                  .ButtonCount(5))
              .DataSource(dataSource => dataSource
                  .Ajax()
                  .Read(read => read.Action("ReadCustomers", "MyController"))
                  .PageSize(20)
              )
              )

 

Here's my script with the AJAX call:

function AddContact(c) {
 
        var row = $(c.target).closest("tr");
        var grid = $('#acombaGrid').data('kendoGrid');
        var dataItem = grid.dataItem(row);
 
        $.ajax({
            url: '@Url.Action("DispalyEntities", "MyController")',
            dataType: "json",
            contentType: "application/json",
            data: {
                customerId: dataItem.CustomerId
            },
            cache: false,
            type: "POST"
        });
    }

 

Here's in brief my Controller:

public IActionResult DispalyEntities(string customerId)
{
    return View();
}

 

My problem is, no matter what I've done so far... my costomerId passed to the controller is always null. Could you please point me what's wrong with it. Thanks in advance for doing so.

Jack
Top achievements
Rank 1
 answered on 18 Apr 2018
1 answer
160 views

https://demos.telerik.com/kendo-ui/spreadsheet/custom-editors

 

cells: [

    { value: "Select item:", bold: true },

{ background: "#fef0cd", validation: { dataType: "list", showButton: true, comparerType: "list", from: '{ "Foo item 1", "Bar item 2", "Baz item 3" }', allowNulls: true, type: "reject"} }]

Neli
Telerik team
 answered on 18 Apr 2018
1 answer
549 views
Hello, I have a two-dimensional string array that I want to bind to kendo mvc grid. It contains two rows. It's able to display the first row as Header, but it's no not showing the second row. Following is my code for the view which receives the said two-dim string array:

@using Kendo.Mvc.UI

@model string[][]


@if (Model != null)
{
    
    var grid = Html.Kendo().Grid<dynamic>(Model)
        .Name("importGridHeader")
        .Columns(columns =>
        {
            var row = Model[0];
            foreach (var col in row)
            {
                columns.Bound(col).Width(200);
            }
        }
        )
        .HtmlAttributes(new { style = "min-height: 450px; max-height:1250px;" })
        .Sortable()
        .Scrollable(s => s.Enabled(true))
        .Resizable(r => r.Columns(true))
        .Filterable()
        .DataSource(dataSource => dataSource
            .Ajax()
            .ServerOperation(false)
         );
    grid.Render();
}
Konstantin Dikov
Telerik team
 answered on 18 Apr 2018
1 answer
362 views

This had previously worked Ok.  Now when I add a controller or a new scaffolded item the scaffolder does not appear.   In VS2017CE in Tools >Extensions and Updates it lists Telerik ASP.NET Core VSExtensions with Version 2018.1.215.2 as being installed.

The only documentation I could find:

https://docs.telerik.com/aspnet-mvc/getting-started/scaffolding

The requirements listed in the doc:

Requirements
Visual Studio 2013 (with Update 2 or higher) or Visual Studio 2015
ASP.NET MVC 4 or ASP.NET MVC 5
C#
Entity Framework Data Model

Not exactly applicable to my set up.  We do not use EF but that hasn't been an issue in the past.  Please advise.

 

 

Pavlina
Telerik team
 answered on 18 Apr 2018
1 answer
111 views

Hello!

I've got some problems with grid using dynamic model and model validation. I am working on app for viewing and updating sql tables. Everything works perfect except updating values. With dynamic model, I am not able to validate model like in microsoft documentation. ModelState.IsValid property is always false ... and that is a problem. (Edited cells in grid are marked as unsaved after update due to ModelState.IsValid == false). Could you help me ? 

Thx,

Tom

Angel Petrov
Telerik team
 answered on 18 Apr 2018
1 answer
91 views

Hi

I am using asp .net core globalisation as per below documentation:

https://docs.telerik.com/aspnet-mvc/getting-started/globalization

Currently we support two language 'English' and 'French'.

If my current language is 'English' and i change to 'french', the kendo UI gets translated properly.

Where as, current language is 'french' and i change to 'English', UI doesn't gets changed to English strings.

I checked both server and client side culture is properly set as English.

 

Is there something i am missing.

 

Thanks and Regards

Sujin

 

Veselin Tsvetanov
Telerik team
 answered on 18 Apr 2018
5 answers
88 views

I have a condition where a grid that displays normally initially persists in showing the editor for the row on the bottom of the grid after you click the edit button (the first time).  If you click the Edit button again the editor will pop up but you can still see the same editor on the page behind it on the bottom of the grid.  The context and transactional part are fine but I cannot explain why this is happening.  It renders fine with respect to popups on other grids in the solution, like 25 of them.

There is no mistake in the html structure with <divs> that might lead to something like this.

Any suggestions would be welcome.

Reid
Top achievements
Rank 2
 answered on 17 Apr 2018
3 answers
286 views

Hi all,

I'm trying to implement persist state functionality in you Grid. I've followed this example.

localStorage["kendo-grid-orders-options"] = kendo.stringify(grid.getOptions());
.
.
.
grid.setOptions(JSON.parse(localStorage["kendo-grid-orders-options"]));

Everything works fine except for one detail. When I set a filter on DateTime field and then refresh the page, it throws an internal error in method.

The binary operator GreaterThanOrEqual is not defined for the types 'System.DateTime' and 'System.String'.

It's caused by the date in FilterDescriptor in DataSourceRequest, which is sent as a string instead of a DateTime (pict2). When it's sent directly from the filter (not from the stored options), it works correctly (pict1). Am I able to store not just the filter value, but also the information about the type?

Konstantin Dikov
Telerik team
 answered on 17 Apr 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?