Telerik Forums
UI for ASP.NET MVC Forum
0 answers
2 views

Today I upgraded one of our web apps to the latest version of UI for ASP.NET MVC and since then the DropDownList component doesn't appear to be rendering/styled correctly. I recreated the theme using the Progress Sass Theme Builder tool to eliminate the stylesheet itself as the issue. I've included screenshots below of what the DropDownList component looks like before and after the upgrade. Can anyone advise? Thanks in advance.

Before upgrade:-

After upgrade:-

Implementation:-

@(Html.Kendo().DropDownListFor(model => model.AssetSubTypeId)
                      .OptionLabel("Asset Type/Subtype...")
                      .BindTo(new SelectList(Lookups.AssetTypeSubType, "Key", "Value"))
                      .Events(events =>
                      {
                          events.Change("onChange_AssetSubTypeDropDownList");
                      }))

Derek
Top achievements
Rank 1
 asked on 20 Jan 2022
1 answer
9 views

When activating the editable.mode in a checkbox it makes the UI control non clickable.


Details: When the mouse hover the checkbox it activates the editable mode on the checkbox but right after that when I try to click it the UI does not response.


Kendo UI version: '2016.1.112'

 

Anton Mironov
Telerik team
 answered on 20 Jan 2022
2 answers
10 views
I'm a beginner who started learning ASP.NET Core just now and wanted to know what the difference was. How much does it differ? Do I need to know ASP.NET MVC fully before learning ASP.NET Core MVC?
ClaudeMj
Top achievements
Rank 1
Iron
 answered on 20 Jan 2022
0 answers
4 views

Hello,

I'm having a strange problem with a cascading dropdown. I have an in cell edit grid for a list in my model. I have two dropdowns in editor templates. CustomerContact cascades from Customer. Both dropdowns are bound to a SelectListItem object on my model with properties "Text" and "Value". Both dropdowns function normally on initial selection and the value of both dropdowns is successfully set as an object. I'm able to use #= data.Text # in a ClientTemplate to display the text of the selected item.

This is where it gets weird. If I click to focus the cell containing my cascaded CustomerContact dropdown, and then click off without actually expanding the dropdown, the value changes from being the whole object to just the DataValueField ("Value" in my case). I've checked and sure enough the datasource change event is triggered when i click off of the cell for the CustomerContact dropdown even though I haven't opened it. This doesn't happen to the Customer dropdown, so it must be something with the cascade but I really can't understand what is causing it. Code below and some screenshots of before and after click my second dropdown's cell. Any help would be appreciated!

Grid:

@(Html.Kendo().Grid(Model.ScheduledInteractions)
     .Name("scheduled-interactions-grid")
     .DataSource(dataSource => dataSource
          .Ajax()
          .Model(model =>
           {
                    model.Id(p => p.Id);
                    model.Field(p => p.Customer).DefaultValue(new SelectListItem() { Text = "- Select -", Value = "-1" });
                    model.Field(p => p.CustomerContact).DefaultValue(new SelectListItem() { Text = "- Select -", Value = "-1" });
             })
            .ServerOperation(false))
            .Columns(c =>
            {
                c.Command(cmd => cmd.Destroy()).Width(100);
                c.Bound(x => x.Customer).EditorTemplateName("CustomerDropdown")
                    .ClientTemplate("#= data.Customer ? data.Customer.Text : '' #" +
                    "<input type='hidden' name='ScheduledInteractions[#= getIndex(data)#].Customer' value='#= data.Customer #' />"
                );
                c.Bound(x => x.CustomerContact).EditorTemplateName("CustomerContactDropdown")
                .ClientTemplate("#= data.CustomerContact ? data.CustomerContact.Text : '' #" +
                    "<input type='hidden' name='ScheduledInteractions[#= getIndex(data)#].CustomerContact' value='#= data.CustomerContact #' />"
                );
                c.Bound(x => x.InteractionType).EditorTemplateName("InteractionTypeDropdown")
                .ClientTemplate("#= InteractionType #" +
                    "<input type='hidden' name='ScheduledInteractions[#= getIndex(data)#].InteractionType' value='#= InteractionType #' />"
                );
                c.Bound(x => x.Description).ClientTemplate("#= Description #" +
                    "<input type='hidden' name='ScheduledInteractions[#= getIndex(data)#].Description' value='#= Description #' />"
                );
            })
            .ToolBar(tb => {
                tb.Create();
            })
            .Navigatable()
            .Editable(editable => editable.Mode(GridEditMode.InCell))
        )

Editor Templates:

@model SelectListItem
    @(Html.Kendo().DropDownListFor(m => m)
        .Name("customer-select")
        .HtmlAttributes(new { @class = "form-control", name = Html.NameFor(m => m) })
        .OptionLabel("- Select -")
        .DataTextField("Text")
        .DataValueField("Value")
        .Filter("contains")
        .DataSource(ds =>
        { 
            ds.Read(read =>
            {
                read.Action("CompanyOptions", "Common", new { Area = "API" }).Data("filterCustomersInGrid");
            }).ServerFiltering(true);
        })
    )
    @Html.ValidationMessageFor(m => m, "", new { @class = "text-danger" })
@model SelectListItem
    @(Html.Kendo().DropDownListFor(m => m)
        .Name("customer-contact-select")
        .HtmlAttributes(new { @class = "form-control", name = Html.NameFor(m => m) })
        .OptionLabel("- Select -")
        .DataTextField("Text")
        .DataValueField("Value")
        .Filter("contains")
        .DataSource(ds => 
        { 
            ds.Read(read => 
            {
                read.Action("ContactOptions", "Common", new { Area = "API" }).Data("filterContactsInGrid");
            }).ServerFiltering(true);
        })
        .AutoBind(false)
        .CascadeFrom("customer-select")
    )
@Html.ValidationMessageFor(m => m, "", new { @class = "text-danger" })

Javascript:

function getCurrentGridRow() {
    var grid = $("#scheduled-interactions-grid").data("kendoGrid");
    var editRow = grid.tbody.find("tr:has(.k-edit-cell)");
    return grid.dataItem(editRow);
}

function filterCustomersInGrid() {
    var row = getCurrentGridRow();
    return { contains: '', currentId: row.Customer ? row.Customer.Value : null };
}

function filterContactsInGrid() {
    var row = getCurrentGridRow();
    return { companyId: row.Customer ? row.Customer.Value : null, contains: '', currentId: row.CustomerContact ? row.CustomerContact.Value : null };
}

function getIndex(dataItem) {
    var data = $("#scheduled-interactions-grid").data("kendoGrid").dataSource.data();
    return data.indexOf(dataItem);
}

Value of Dropdowns After Initial Selections

After Cell Click:


Sarah
Top achievements
Rank 1
 updated question on 19 Jan 2022
0 answers
1 view

Hi guys,

we been using Kendo version 2020.1.406.545. is it a must to upgrade to the latest?

kind regards

Tony

Tony
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 19 Jan 2022
0 answers
2 views

Hi guys, im trying to read network path saved in the database to read an image.

i have the path saved as \\TP-amk-camp02\somefolder\somefolder\2022-01-21 \ Data\ in the database. How can i read the network path to display it on the grid?

see below html markup


  columns.Bound(c => c.ThumnailPath).Title("Thumbnailscan").Width(249).Encoded(false).ClientTemplate(
                        "<div style='text-align:left;'>#=FolderGUID ? FolderGUID : '' #  </div> " +
                            "<div id='ExampleBox_#=FolderGUID ? FolderGUID : -1#' data='#=FolderGUID#' class='Example_Box'>" +
                                "<img  class='Example_Image' id='ExampleImage_#=FolderGUID#' src=' " + Url.Content("#:data.ThumnailPath#") + "thumbnails.jpg'/> " +

 

kind regards

Tony

Tony
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 19 Jan 2022
1 answer
6 views

I am attempting to keep the Gantt Chart editable, but remove the ability to create new tasks/child entries.

 

I have tried adding this CSS and it did not work:

  .k-gantt-actions .k-button {
            visibility: hidden;
        }

The button still shows.

 

Any help?

Yanislav
Telerik team
 answered on 19 Jan 2022
1 answer
7 views
In the grid control I want to do GridFilterMode.Row filtering but to increase performance I want to remove the auto complete and default filtering.  How can I disable that option and just make it a manual filter only?
Eyup
Telerik team
 answered on 19 Jan 2022
1 answer
7 views

We've added the Telerik.UI.for.AspNet.Mvc4.2021.3.1207 NuGet package to our project and I was wondering what the best practices are for excluding unneeded content from publishing. There is a folder called 2021.3.1207-source which by default is published with all the other content that the NuGet package has added. So far we have manually marked the content to not be included when published in our build pipelines, but we're wondering if there is a more standard way of doing this? Is there a NuGet package which excludes the source folder?

In addition to this, is there a preferred method of excluding themes from a project? Again we can manually remove them or mark them to not be published, but I was wondering if there is a suggested way to configure what is and isn't included.

Many thanks

Ivan Danchev
Telerik team
 answered on 19 Jan 2022
1 answer
6 views
I'm using a kendo UI grid for MVC and I've managed to create a dropdown for a field in the grid using an editor template.  The only problem is that the drop-down does not default to the value that is currently in the field. Can someone explain how to do this or point me to a demo? Thanks.
Eyup
Telerik team
 answered on 18 Jan 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Richard
Top achievements
Rank 2
Iron
Iron
Iron
Bernd
Top achievements
Rank 3
Iron
Iron
Iron
Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
CHIHPEI
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Richard
Top achievements
Rank 2
Iron
Iron
Iron
Bernd
Top achievements
Rank 3
Iron
Iron
Iron
Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
CHIHPEI
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?