Telerik Forums
UI for ASP.NET Core Forum
7 answers
2.8K+ views

My apologies if this is the wrong forum for this, but I am having some trouble with a dropdownlist validation

<div class="form-group">
        <label asp-for="RoleModuleId" class="control-label col-md-2">Module</label>
        @(Html.Kendo().DropDownListFor(c => c.RoleModuleId)
              .OptionLabel("-- Select a Module --")
              .HtmlAttributes(new { style = "width:21%", id = "moduleDropdown", required = "required" })
              .BindTo(Model.Modules.OrderBy(c => c.Name))
              .DataTextField("Name")
              .DataValueField("Id"))
    </div>
    <div class="form-group">
        <label asp-for="Name" class="control-label col-md-2">Name</label>
        @(Html.Kendo().TextBox()
            .Name("Name")
            .HtmlAttributes(new { style = "width: 100%", placeholder = "Name of role", required = "required" })
        )
    </div>

With the TextBox if there is nothing selected it will give a little warning message and have the box flash red, and it will prevent the form from submitting. Similarly if nothing is selected for the dropdownlist it will prevent the form from being submitted, but will give no indication. This comes across that there is something wrong with the form, and I believe could cause some confusion.

 

Is this intended behavior or am I missing something?

 

Be well,

Bradley

Petar
Telerik team
 answered on 22 Mar 2021
3 answers
164 views

Hi,

I tried to use dynamic object with Grid on PopUp Edit Mode, but the popup render the elements of the DataTable instead of the columns. (view attach files).

No problem in inline mode.

How to fix this ?

I use the example here.

https://github.com/telerik/ui-for-aspnet-core-examples/blob/master/Telerik.Examples.Mvc/Telerik.Examples.Mvc/Views/Grid/Dynamic.cshtml

 

Regards.

Florian
Top achievements
Rank 1
 answered on 19 Mar 2021
3 answers
119 views

Hello,

my request refers to the example here:
https://demos.telerik.com/aspnet-core/diagram/editing

Is it possible to set the position for each item?
It looks like the connectors are not moved to the new position, see attachment.

Maybe you could help with an example for asp.net core

 

Best regards,

Oliver

Anton Mironov
Telerik team
 answered on 19 Mar 2021
1 answer
115 views

The input tag used by DropDownList is sometimes briefly visible on the page while JavaScript and CSS assets are loading.

If the input tag is meant to be hidden anyway, why aren't you writing the style attribute out with the HTML from the tag helper?

Instead it's being set by the associated scripts, which means the input is visible until the script has loaded and run.

Ivan Danchev
Telerik team
 answered on 18 Mar 2021
4 answers
339 views

I am building a wizard using tag helpers and I have a few questions.

1. How can I set the class on the step buttons?

2. I want to do some manual validation on the next button.  I have the click event hooked up and the validation is working but I can't prevent the wizard from moving to the next step.

3. I want my final step to not have any buttons. Is this possible?

4. How do I disable clicking on the step number to move through the wizard?

Ivan Danchev
Telerik team
 answered on 18 Mar 2021
1 answer
403 views

I'm using the .NET Core HTMLHelper to instantiate an instance of the tile layout, the problem I'm running into is that the tile widths just shrink instead of reacting like a flex where the cards will stack as the layout gets narrower. Is there a way to do this either via javascript or CSS?

Code:

01.@(Html.Kendo().TileLayout()
02.        .Name("StatsTiles")
03.        .Columns(4)
04.        .Containers(c =>
05.        {
06.            c.Add()
07.                .Header(h => h.TemplateId("header-0"))
08.                .BodyTemplateId("container-0")
09.                .RowSpan(3);
10.            c.Add()
11.                .Header(h => h.TemplateId("header-1"))
12.                .BodyTemplateId("container-1");
13.            c.Add()
14.                .Header(h => h.TemplateId("header-2"))
15.                .BodyTemplateId("container-2")
16.                .RowSpan(3);
17.            c.Add()
18.                .Header(h => h.TemplateId("header-3"))
19.                .BodyTemplateId("container-3")
20.                .RowSpan(3);
21.            c.Add()
22.                .Header(h => h.TemplateId("header-4"))
23.                .BodyTemplateId("container-4");
24.            c.Add()
25.                .Header(h => h.TemplateId("header-5"))
26.                .BodyTemplateId("container-5");
27.            c.Add()
28.                .Header(h => h.TemplateId("header-6"))
29.                .BodyTemplateId("container-6")
30.                .ColSpan(4);
31.        })
32.        .RowsHeight("100")
33.    )

 

I would like to resize the height and width of all of the containers so that at certain breakpoints the Layout changes it's grid setting. Currently it seems that the grid CSS is all being placed inline, so you can't overwrite that with a media query in the CSS. I've also tried using a jQuery function on window resize to set the options of the tile layout, but the layout doesn't change and some of the content within the containers disappears.

Window resize code:

01.$(window).resize(function () {
02.    if ($(window).width() <= 767.98) {
03.        var statTiles = $('#StatsTiles').getKendoTileLayout();
04.        var containers = statTiles.options.containers;
05. 
06.        for (var i = 0; i < containers.length; i++) {
07.            containers[i].colSpan = 1;
08.            containers[i].rowSpan = 1;
09. 
10.            if (i  == 0 || i == 2 || i == 3 || i == 6)) {
11.                containers[i].height = 300;
12.            } else {
13.                containers[i].height = 100;
14.            }
15.        }
16. 
17.        statTiles.setOptions({
18.            containers: containers,
19.            columns: 1
20.        });
21.    }
22.});

 

Thanks in advance,

Nick

Tsvetomir
Telerik team
 answered on 17 Mar 2021
1 answer
93 views
I am trying to add a form inside a hierarchy grid in place of nested grid using clientdetailtemplateid but it's not getting bounded.
Tsvetomir
Telerik team
 answered on 16 Mar 2021
1 answer
224 views

Razor FileManager RootPath

 

How do I set the RootPath in the Core FileManager to use an Uploads folder that already exists?  Is this done in the cshtl page of the cshtml.cs page?  

 

 

 

 

 

Ianko
Telerik team
 answered on 16 Mar 2021
5 answers
572 views

Hi

 

 

.... bla bla bla

.EventTemplate(

        "<div class='eventItem' style='margin-left: 10px;'>" +

        "<label class='mt-checkbox mt-checkbox-outline'>" +
        "#= kendo.toString(start, 'HH:mm') # - #= kendo.toString(end, 'HH:mm') #"+
        "        <input  type='checkbox' onchange='onCheckboxChange(#=Id#,#=kendo.toString(uid)#)'  #=data.cancelled ? checked='checked' : ''#  class='input-small'> #= title # Seç" +
        "        <span></span>" +
        " </label>"+

 "</div>"
)
.DataSource(d => d
           .ServerOperation(true)
           .Read(m => m.Action("Takvimler_Read", "Kullanici", new { area = "Yonetim" }).Data("GetSchedulerData"))
))

 

.... bla bla bla

 

view in code inspector

<input type="checkbox" onchange="onCheckboxChange(1916,05d45395-b80b-4eb1-9700-80c1d7592f0c)" class="input-small">

function

 

    function onCheckboxChange(Id, Uid) {
        console.log("CheckboxChange Id", Id)
        console.log("CheckboxChange Uid", Uid)
    }

 

error

When the checkbox is clicked, an error occurs while passing the Uid value to the function with the parameter.

Uncaught SyntaxError: Invalid or unexpected token

 

 

Petar
Telerik team
 answered on 16 Mar 2021
4 answers
141 views

Hi,

I thought I should let you know that the issue with Fire Fox and the Editor, where it is unable to get focus if not shown on the page initially is still present in Firefox 68.4.1esr. This is an asp.net core 3.1 app using UI for asp.net Core v2019.3.1023

The js refresh fix  as described here https://www.telerik.com/forums/editor-issues-with-firefox-17 fix still works.

For me, I have the Editor embedded in a Tab page and I am triggering the refresh within the onShow client event.

<div class="form-row">
       <div class="form-group col-md-12">
           <label class="control-label">Event Text</label>
 
           @(Html.Kendo().Editor()
                 .Name("editor")
                 .HtmlAttributes(new { style = "height:200px", required="required" })
                 .Tools(tools => tools
                     .Clear()
                     .Bold().Italic().Underline().Strikethrough()
                     .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
                     .InsertUnorderedList().InsertOrderedList()
                     .Outdent().Indent()
                     .SubScript()
                     .SuperScript()
                     .CleanFormatting()
                 )
                 .StyleSheets(css => css
                   .Add(Url.Content("~/css/editorBase.css"))
                 )
           )
       </div>
   </div>

 

function onShow(e) {
           if (currentIndex == 2 && !isMovingBack) {
               setTimeout(refreshEventGrid(), 50);
               jQuery("#selectedEventDefinition").val("");
           }
 
            if (currentIndex == 3 && !isMovingBack) {
                   setTimeout(function () {
                       var editor = jQuery('#editor').data("kendoEditor");
                       editor.refresh();
                   }, 50);
           }
 
           progress.value(currentIndex + 1);
 
       }

 

I'm not sure if there is anything you can do to address this as it seems to be a Firefox issue. I did find a bugzilla reference mentioned in a post somewhere but that points to a very old closed bug: https://bugzilla.mozilla.org/show_bug.cgi?id=254144

 

Thanks

Chris

 

Veselin Tsvetanov
Telerik team
 answered on 15 Mar 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
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
Iron
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?