Telerik Forums
UI for ASP.NET Core Forum
2 answers
129 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.4K+ views
Are there any plans to create a kanban component?
Jonh
Top achievements
Rank 1
 answered on 23 Sep 2019
1 answer
60 views

Hello,

How to select an item by Id or datasorce value?

 

robert

Preslav
Telerik team
 answered on 23 Sep 2019
1 answer
155 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
359 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.4K+ 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
2 answers
127 views

I am getting complains from our customers that they cannot right click and paste into the Editor tool. I tested this in IE11, Chrome, and Firefox. The only one that could do a right-click and paste was Chrome. The other browsers, you have to Ctrl+V.

 

Is there a fix for this?

 

Here is my code for the editor:

@(Html.Kendo().EditorFor(o => o.Content)
.Encoded(false)
.Resizable(true)
.Tools(tools => tools
.Clear()
.Bold()
.Italic()
.Underline()
.Strikethrough()
.JustifyCenter()
.JustifyFull()
.JustifyLeft()
.JustifyRight()
.InsertUnorderedList()
.InsertOrderedList()
.Indent()
.Outdent()
.CreateLink()
.Unlink()
.TableEditing()
.Formatting()
.CleanFormatting()
.FontName()
.FontSize()
.ForeColor()
.BackColor()))
Joshua
Top achievements
Rank 2
 answered on 19 Sep 2019
3 answers
307 views

My kingdom for a good sample.

I am trying to use a custom popup template with a couple of dropdownlists and have them cascade. This is in asp.net core (NOT MVC).

My big questions are how to do the cascade and pass forgeryToken with it and how to receive the cascade call (i.e. the function signature). Below is what I have now and it doesn't work.

Another question I have is, what should the signature of the c# function be for the second (traits) dropdown be on the server.

Currently, I have:

public ActionResult OnPostCropsReadAsync([DataSourceRequest] DataSourceRequest request)

How do I get the id of the first dropdownlist to know how to filter?

THanks … Ed

Here's the popup template and below that is the calling grid.

01.@model TCWP.Pages.IndexModel.CertificateModel
02.@{
03.    ViewData["Title"] = "Certificate";
04.}
05.<container>
06.    <div class="row">
07.        <div class="col-md-6">
08.            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
09.            <div class="form-group">
10.                <label>Crop</label>
11.                @(Html.Kendo().DropDownListFor(m => m.CropId)
12.                                                        .DataValueField("CropId")
13.                                                        .DataTextField("CommonName")
14.                                                        .AutoBind(true)
15.                                                        .HtmlAttributes(new { style = "width:100%" })
16.                                                         .AutoWidth(true)
17.                                                         .Filter(FilterType.Contains)
18.                                                         .DataSource(source =>
19.                                                         {
20.                                                                source
21.                                                                .Ajax()
22.                                                                .PageSize(40)
23.                                                                .Read(r => r.Url("?handler=CropsRead")
24.                                                                .Type(HttpVerbs.Post).Data("forgeryToken")
25.                                                                );
26.                                                         }).SelectedIndex(0)
27.                )
28. 
29.            </div>
30.            <div class="form-group">
31.                <label>Trait</label>
32.                @(Html.Kendo().DropDownListFor(m => m.TraitId)
33.                                                        .DataValueField("TraitId")
34.                                                        .DataTextField("TraitDesc")
35.                                                        .AutoBind(true)
36.                                                        .HtmlAttributes(new { style = "width:100%" })
37.                                                         .AutoWidth(true)
38.                                                         .Filter(FilterType.Contains)
39.                                                         .DataSource(source =>
40.                                                         {
41.                                                                source
42.                                                                .Ajax()
43.                                                                .PageSize(40)
44.                                                                .Read(r => r.Url("?handler=TraitsRead")
45.                                                                .Type(HttpVerbs.Post).Data("GetCascadeData")
46.                                                                );
47.                                                         }).SelectedIndex(0)
48.                )
49. 
50.            </div>
51.        </div>
52.    </div>
53.</container>
54. 
55.<script type="text/javascript" >
56.  function GetCascadeData()
57.    {
58.        debugger;
59.        var tmp =  $.extend(true, {}, forgeryToken(),
60.            {
61.                CropId = $("#Input_CropId").Input.val();
62.            });
63.        return tmp;
64. 
65.    }
66.</script>

 

 

 

01.    @(Html.Kendo().Grid<IndexModel.CertificateModel>()
02..Name("grid")
03..ToolBar(t =>
04.{
05.    t.Create().Text("Add New");
06.})
07..HtmlAttributes(new { style = "height: 850px;" })
08..Editable(e => e.Mode(GridEditMode.PopUp).TemplateName("CertificateEditTemplate")
09.    .Window(w => w.Title("Certificate").Width(650)))
10..Events(evt => { evt.Edit("OnEdit"); })
11.            .Columns(columns =>
12.            {
13.                columns.Bound(c => c.CertId).Width(100).Visible(false);
14.                columns.Bound(c => c.CropName).Width(150);
15.                columns.Bound(c => c.TraitName).Width(150);
16.                columns.Bound(c => c.UserFullName).ClientTemplate("#=UserFullName#").Width(150).Visible(false);
17.                columns.Bound(c => c.OriginCountryName).Width(150);
18.                columns.Bound(c => c.IssuingCountryName).Width(150);
19.                columns.Bound(c => c.YearIssued).Width(110)
20.                    .HtmlAttributes(new { style = "text-align:right; " });
21.                //   .HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" });
22.                columns.Bound(c => c.ExpirationDate).Width(150).Format("{0:d}").HtmlAttributes(new { style = "text-align:right; " });
23.                //.HeaderHtmlAttributes(new { style = "overflow: visible; white-space: normal" }); ;
24.                columns.Command(c =>
25.                {
26.                    //    c.Destroy().Text("Delete");
27.                    c.Edit();
28.                }).Visible(User.IsInRole("Admin")).Width(85);
29.                                    columns.Command(c => c.Custom("Print").Click("OnRunReport").HtmlAttributes(new { style = "height:25px" })).Width(70);
30.                                })
31.            .Resizable(resize => resize.Columns(true))
32.            .Selectable(s => s.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
33.            .Scrollable()
34.            .Groupable()
35.            .Filterable()
36.            .Sortable()
37.            .Pageable() //p => { p.PageSizes(true); })
38.            .DataSource(ds =>
39.                                ds.Ajax()
40.                         .Batch(true)
41.                                .Events(ev => ev.Error("errorHandler"))
42.                                .ServerOperation(false)
43.                                .Read(r => r.Url("?handler=CertsRead").Data("forgeryToken"))
44.                                .Update(u => u.Url("?handler=CertsUpdate").Data("forgeryToken"))
45.                                .Create(c => c.Url("?handler=CertsCreate").Data("forgeryToken"))
46.                                .Model(m =>
47.                                {
48.                                    m.Id(c => c.CertId);
49. 
50.                                })
51.                .PageSize(20)
52. 
53.                )
Tsvetomir
Telerik team
 answered on 19 Sep 2019
1 answer
473 views
If you look at the demo https://demos.telerik.com/aspnet-core/drawer/tag-helper, you can expand the drawer but as soon as you click one of the drawer items it auto-collapses. How can we avoid this behavior and keep the drawer expanded?
Tsvetomir
Telerik team
 answered on 18 Sep 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?