Telerik Forums
UI for ASP.NET Core Forum
4 answers
392 views

HI

I have a ASP.NET MVC/ASP.NET Core MVC compatibility question 
about ASP.NET Core MVC Grid.

Why the following code not available in .NET Core 2.2 ?

.cshtml

  columns.Template(template => { }).ClientTemplate(" ");

  More detail :

        .Columns(columns =>
        {
          ...
          columns.Template(template => { }).ClientTemplate(" ");
        })

I think Telerik have the responsibility keep the code of recent version
(R2 2017, R2 2019...) to compatible with ASP.NET Core MVC.

Private implementation changed but should try to keep the public property/method the same.

It is the Value/Reason Why We choose Telerik.

Best regards

Chris

 

 

Georgi
Telerik team
 answered on 27 Sep 2019
2 answers
91 views

I have a situation where I don't know the number of columns I need at design time.

I want to do something like:

DateTime dt = DateTime.Now.Date;
int dayCount = 30;
.Columns(columns =>
{
    for (int i = 0; i < dayCount ; i++)
    {
          columns.Bound(model.datedata).Title(dt.AddDays(i).ToString())… blah blah blah
    }
}

 

Can someone show me an example of how to do this. Nothing I've found on the web seems to fit this bill.

Thanks …. Ed

 

Randy Hompesch
Top achievements
Rank 1
 answered on 25 Sep 2019
1 answer
369 views

Hi.

How I can change the value before export data to PDF?
I have a checkbox, and I need to change the format, I want to write YES/NO for checkboxes.
Is it possible to change PDF export to say Yes / No for check-boxes?

Alex Hajigeorgieva
Telerik team
 answered on 25 Sep 2019
2 answers
111 views

Not sure if the drawer is really meant for this, as it seems a bit more like a highly interactive tab control than just being a fly-out. But is there a way to have 2 drawers, one on the left and another on the right?

I'd like to have the left handle navigation, and the right be a fly-out for other various things.

Thanks

Richard
Top achievements
Rank 1
 answered on 25 Sep 2019
2 answers
1.4K+ views

I hope this is an easy fix.  I have a DropDownList in my Grid which seems to be working fine except the selected value is not being returned to the Controller Action.  For example, when I select a new value for "Type" below, it still shows the original value in the model in the Controller.  See "<--" NOTES BELOW.

Thanks very much for the help.

*** MODEL ***
public class SelectValueViewModel
    {
        public int Id { get; set; }

        public string Code { get; set; }

        public string Description { get; set; }

        [UIHint("SelectValuesTypeDropDown")]
        public string Type { get; set; }  // <-- TRYING TO UPDATE THIS VALUE WITH THE DROP DOWN.

        public List<SelectListItem> CodeTypes { get; set; }
    }

*** VIEW ***
@(Html.Kendo().Grid<CCMC.View_Models.SelectValueViewModel>()
    .Name("SelectValuesGrid")
    .Columns(c =>
    {
        c.Bound(m => m.Code).Width(100);
        c.Bound(m => m.Description).Width(100);
        c.Bound(m => m.Type).Width(100);
        c.Command(command => { command.Edit(); }).Width(200);
        c.Command(command => command.Destroy()).Width(150);
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable()
    .Sortable()
    .Scrollable()
    //    .HtmlAttributes(new { style = "height:550px;" })
    .DataSource(dataSource => dataSource
    .Ajax()
    .PageSize(20)
    .Model(model =>
    {
    model.Id(sv => sv.Type);
    //            model.Field(sv => sv.Id).Editable(false);
    })
    .Events(events => events.Error("error_handler"))
    .Read(read => read.Action("Read", "SelectValues"))
    .Update(update => update.Action("Edit", "SelectValues").Data("sendAntiForgery"))
    .Destroy(destroy => destroy.Action("Delete", "SelectValues"))
    )
)


*** EDIT TEMPLATE ***
@model CCMC.View_Models.SelectValueViewModel


@(Html.Kendo().DropDownListFor(m => m.Type)
            .DataValueField("Value")
            .DataTextField("Text")
            .BindTo(Model.CodeTypes)
            .BindTo((System.Collections.IEnumerable)ViewData["SelectValueTypes"])
)


*** CONTROLLER ***
[AcceptVerbs("Post")]

        [HttpPost]
        [ValidateAntiForgeryToken]


        public async Task<JsonResult> Edit([DataSourceRequest] DataSourceRequest request, SelectValueViewModel model)
        {
             model.Type  // <--- THE VALUE IS NOT UPDATED HERE.  STILL HAS THE ORIGINAL VALUE.
        }

Chris
Top achievements
Rank 1
 answered on 24 Sep 2019
7 answers
1.3K+ views
Are there any plans to create a kanban component?
Jonh
Top achievements
Rank 1
 answered on 23 Sep 2019
1 answer
55 views

Hello,

How to select an item by Id or datasorce value?

 

robert

Preslav
Telerik team
 answered on 23 Sep 2019
1 answer
140 views

Hello,

Is it possible to have scrolling in the Vertical Timeline?

(I have fix heigh of my views)

robert

Preslav
Telerik team
 answered on 23 Sep 2019
1 answer
338 views

Hello,

is there a way to overwrite the browsers (chrome and firefox) default behavior for middle or right click on custom buttons in a grid?

We are trying to get the middle mouse click on a custom command button in a grid.

With this line we only get the left mouse click, the middle and right are ignored/use the default browser commands 

command.Custom("Details").Text(" ").Click("showDetails").IconClass("fas fa-eye");

Middle - new tab

Right - context menu

We tryed using JS on the mousedown event but it didn't work and in the "showDetails" method we only get the left mouse button

$('.k-grid-Details').on('mousedown', function (e) {
    debugger
     if (e.which == 1) {
       e.preventDefault();
       alert("middle button");
});

 

 

Eyup
Telerik team
 answered on 20 Sep 2019
1 answer
1.3K+ views
How do I call my MVC Core Controller Actions for Create, Update, and Delete from the Grid and Grid Rows.  My previous version used the following code, but the new Core version does not work:

c.Bound(m => m.DeliveryDocumentNumber).ClientTemplate(Html.ActionLink("Edit", "Edit", "Orders", new { id = "#=Id#" },     null).ToString()).Title("").Filterable(false).IncludeInMenu(false);
c.Bound(m => m.DeliveryDocumentNumber).ClientTemplate(Html.ActionLink("Details", "Details", "Orders", new { id = "#=Id#" }, null).ToString()).Title("").Filterable(false).IncludeInMenu(false);

c.Bound(m => m.DeliveryDocumentNumber).ClientTemplate(Html.ActionLink("Delete", "Delete", "Orders", new { id = "#=Id#" }, null).ToString()).Title("").Filterable(false).IncludeInMenu(false);

I want to use the Controller Views for CRUD operations and not the Grid since the Grid only shows a subset of the data.

Thanks.
Eyup
Telerik team
 answered on 20 Sep 2019
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?