Telerik Forums
UI for ASP.NET Core Forum
2 answers
1.3K+ views

Hi,

I'm trying to set the maximum length of input characters using HtmlAttributes in a form. But it seems it doesn't work; I can still type more than 4 characters. Here is an example in REPL:

https://netcorerepl.telerik.com/wmkmbflo51nxiZPb01


                   i.Add()
                        .Field(f => f.FirstName)
                        .Editor(e=> e.TextBox().HtmlAttributes(new { maxlength = "4" }))
                        .Label(l => l.Text("First Name:"));

Thanks,

Humberto

 

Humberto
Top achievements
Rank 1
Iron
 answered on 18 Feb 2022
1 answer
167 views
I don't want the user to be able to type in the Text part of the combo box.  They are required to select from the options provided.  How do I prevent typing?
Tsvetomir
Telerik team
 answered on 18 Feb 2022
1 answer
111 views
Trying to figure out if there is a way to pick if the items will be on the left or right, i dont want to alternate but rather pick which ones will be on each side.  If anyone knows how and could pass on the info that would be great!
Alexander
Telerik team
 answered on 17 Feb 2022
1 answer
57 views

Hello,

PDF search is not working when PDF viewer is placed in modal. Is there any workaround for this?

Thanks.

Boris
Top achievements
Rank 1
Iron
Iron
 answered on 17 Feb 2022
5 answers
993 views
I'm using the MVC extensions to setup my Tree List

@(Html.Kendo().TreeList<SiteMapTreeModel>()
      .Name("treelist")
      .Columns(columns =>
          {
              columns.Add().Field(c => c.Title).Title("Title").Width(250);
              columns.Add().Field(c => c.Url).Title("URL");
          })
      .DataSource(dataSource => dataSource
          .Read(read => read.Action("SiteMapTree", "HomeAjax").Data("getServiceAndLocale"))
          .Model(model =>
              {
                  model.Id(m => m.Id);
                  model.ParentId(m => m.ParentId);
                  model.Field(m => m.Title);
                  model.Field(m => m.Url);
              })
      )
      .AutoBind(false)
      .Selectable(true)
      .Deferred()
      .Height(540))

... and using Chrome Dev Tools > Network, I see the following data in the AJAX method SiteMapTree, but the Tree List says "No records to display":

{"Data":[{"Id":1602,"ParentId":1000,"Title":"Dashboard","Url":"~/Dashboard/Start","hasChildren":true},{"Id":22,"ParentId":1000,"Title":"Rules","Url":"~/Rules/Start","hasChildren":true},{"Id":1,"ParentId":1000,"Title":"Administration","Url":"~/Admin/Start","hasChildren":true}],"AggregateResults":{},"Errors":null}

... and I am using ToTreeDataSourceResult() in the AJAX method to format the data (and ParentId of 1000 is the root of the tree).

What am I doing incorrectly?

FYI: I have set the AutoBind of the TreeList to false because I am calling dataSource.read(); when a dropdownlist item is selected. The Tree List has no context until the dropdown is selected.

Thanks,
--John
Vi
Top achievements
Rank 1
Iron
 answered on 17 Feb 2022
1 answer
105 views

<div class="form-group">
                        <label asp-for="Summ">Стоимость от</label>
                        @(Html.Kendo().NumericTextBox<decimal>()
                            .Name("Summ")
                            .Min(0)
                            .Value(Model.Summ)
                            .HtmlAttributes(new { style = "width: 100%" })
                        )
                    </div>

public class ServiceViewModel
    {
        ......
        public decimal Summ { set; get; }.....
    }

var supportedCultures = new[] { new CultureInfo("ru-RU") };

            app.UseRequestLocalization(new RequestLocalizationOptions
            {
                DefaultRequestCulture = new RequestCulture("ru-RU"),
                SupportedCultures = supportedCultures,
                SupportedUICultures = supportedCultures
            });

<script src="~/lib/kendo/js/cultures/kendo.culture.ru-RU.min.js"></script>

the database contains a value, but does not display it correctly.And also, when saving the form, it does not take a value in the model, therefore, in the controller, the value is 0.How to fix it all? 
Mihaela
Telerik team
 answered on 16 Feb 2022
1 answer
181 views

Hi

 

I would like to filter a string column with multiple keyword, can you advice how I can do that?

example. country column, filter by entering "USA, UK, India";

I know I can set checkbox filter menu, but I would like user to enter the test instead.

Thank you.

Tsvetomir
Telerik team
 answered on 16 Feb 2022
1 answer
914 views

in the form using tag helpers, how can I set textbox-editor as password?

                    <form-item field="Password">
                        <item-label />
                        <textbox-editor ></textbox-editor> ???????????
                    </form-item>

 

   
Mihaela
Telerik team
 answered on 15 Feb 2022
1 answer
1.7K+ views

Hi, I'm new to Telerik ASP.NET Core, so maybe this is a simple task. I'm using Razor Pages and would like to hide the label from one field, how can this be done? From the switch field.

Thanks,

Humberto

                    @(Html.Kendo().Form<ProfileModel>()
                            .Name("formExample")
                            .FormData(Model?.Input)
                            .HtmlAttributes(new { method = "POST" })
                            .Layout("grid")
                            .Grid(g => g.Cols(1).Gutter(0))
                            .Items(items => {
                                items.AddGroup()
                                    .Label("Security")
                                    .Layout("grid")
                                    .Grid(g => g.Cols(2))
                                    .Items(i =>
                                    { 
                                        i.Add()
                                            .Field(f=> f.TFA)
                                            .Editor(e => e.Switch());
                                });

                            })
                            .Validatable(v =>
                            {
                                v.ValidateOnBlur(false);
                                v.ValidationSummary(false);
                                v.ErrorTemplate("<span style='color: red'>#:message#</span>");
                            })
                    )                

Petar
Telerik team
 answered on 15 Feb 2022
1 answer
75 views

version 2022.1.119

My chart is freezing due to an infinite loop in DateCategoryAxis.scaleRange upon scrolling the mouse wheel over the chart (in an attempt to just scroll the page itself).

I have Zoomable(false) and Pannable(false).

The while condition highlighted below is never false when "delta" is not a positive integer (>= 1) or zero.
In my case, the function was passed delta = 0.3, so the loop iterates 0.3, -0.7, -1.7, -2.7, etc.

            scaleRange: function (delta) {
                var rounds = Math.abs(delta);
                var result = this.range();
                var from = result.min;
                var to = result.max;
                if (from && to) {
                    while (rounds--) {
                        var range = dateDiff(from, to);
                        var step = Math.round(range * 0.1);
                        if (delta < 0) {
                            from = addTicks(from, step);
                            to = addTicks(to, -step);
                        } else {
                            from = addTicks(from, -step);
                            to = addTicks(to, step);
                        }
                    }
                    result = {
                        min: from,
                        max: to
                    };
                }
                return result;
            },

It looks like there are other definitions of scaleRange() that are using the same code that probably would also need fixing.

EDIT:  it appears that the reason "delta" is being passed in as 0.3 is because in the handler Chart._mousewheel:

totalDelta = -1
this$1._mousewheelZoomRate() == 0.3
therefore:  -totalDelta * this$1._mousewheelZoomRate() == 0.3

I haven't dug into the code enough to know whether or not this is an issue, or is expected.

Greg
Top achievements
Rank 1
Iron
 answered on 14 Feb 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Robert
Top achievements
Rank 1
Luis Cordoba
Top achievements
Rank 1
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
Membatalkan pinjaman
Top achievements
Rank 2
Want to show your ninja superpower to fellow developers?
Top users last month
Robert
Top achievements
Rank 1
Luis Cordoba
Top achievements
Rank 1
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
Membatalkan pinjaman
Top achievements
Rank 2
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?