Telerik Forums
UI for ASP.NET Core Forum
1 answer
124 views

Hello everyone,

I'm encountering this issue when loading a page with the RadTimeline, the error is shown below:

"Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property."

 

This issue is occurring when this page is getting back a lot of entitles for the timeline, the MaxJsonLength is set in web.config but it seems this only applies to Web Services.

Unsure how to set this in the code as it looks like the serialization happens in the RadDataBoundControl if I'm not mistaken.

Any ideas how to to implement this MaxJsonLength in code?

 

Thanks for any help!

Alexander
Telerik team
 answered on 24 Nov 2023
1 answer
74 views

Hello everyone,

 

First of all, we did not renew our telerik license and we are using the latest possible telerik version we can get for a long time.

Last week our devops publish failed because of dotnet tools download failure. We had detailed look on the fail and found out that telerik nuget feed causing the error. We literally changed nothing about versions in the code but still we get the error nonetheless. Even the latest successfull published commit is giving the same error. Publish from VS is also giving the same error and Nuget solution with telerik package source in VS still works fine with our telerik credentials.

What is the reason for that, can anyone help us?

Thanks.

 

Alexander
Telerik team
 answered on 23 Nov 2023
1 answer
31 views

When I try to add a label to a DropDownList, it gives me a syntax error as if the property doesn't exist.  Thoughts?

CS1929
'DropDownListBuilder' does not contain a definition for 'Label' and the best extension method overload 'HtmlHelperLabelExtensions.Label(IHtmlHelper, string)' requires a receiver of type 'Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper'

                    @(Html.Kendo().DropDownList()
                        .Name("PrimaryAnalystId")
                        .Label(label => label.Content("Primary Analyst"))
                        .OptionLabel("[Select a person]")
                        .DataTextField("Person")
                        .DataValueField("PersonId")
                        .DataSource(s => s.Read(r =>
                            r.Action("GetPeople", "Utility", new { type = "analyst" })))
                        .HtmlAttributes(new { required = "required", validationmessage = "Primary analyst is required." }))


Brian
Top achievements
Rank 2
Iron
 updated answer on 16 Nov 2023
0 answers
43 views

I have a multiselect whose items cascade from the the selected value of a drop down list.

When the page is loaded, the drop down list selection defaults to the first item in the list, which results in two items in the multiselect and the multiselect popup height shows the two items.

If a different drop down list option is selected, there are 15 items in the multiselect but the popup height still shows two items at a time. The scroll buttons work, but I would like to increase the height so that more options are visible. I have tried setting the height of the multiselect, but it has no effect.

Is there a way to resize the popup height when the items in the multiselect changes or to specify a minimum height of say 4 lines?

Thank you

Tim
Top achievements
Rank 3
Iron
Iron
Iron
 updated question on 15 Nov 2023
1 answer
39 views

Hi,

The following code snippet is passing validation incorrectly.  It is marked on the field and model as Required but is not being flagged as such when no option is selected.

HTML5 (form):

<div class="form-floating mb-3">
    @(Html.Kendo().DropDownListFor(m => m.PrimaryAnalystId).OptionLabel(new { Person = "[Select a person]", PersonId = 0 }).DataTextField("Person").DataValueField("PersonId").DataSource(s => s.Read(r => r.Action("GetPeople", "Utility", new { type = "analyst" }))).HtmlAttributes(new { @class = "form-select", required = "required" }))
    <label asp-for="PrimaryAnalystId">Primary Analyst</label>
</div>

C# (model):

[Required]
public int PrimaryAnalystId { get; set; }

TS/JS (validator):

const validator = $("#form1").kendoValidator({ validationSummary: { container: "#summary" } }).data("kendoValidator");

$(function () {
    $("#submit").on("click", function (event) {
        event.preventDefault();

        if (validator.validate()) {
            alert('valid');
        } else {
            alert('invalid');
        }
    });
});

Alexander
Telerik team
 answered on 15 Nov 2023
1 answer
82 views

Hi!

Where does ScrollView auto-scroll start? I didn't find this in the documentation and examples. I was sure that this function should be in ScrollView, like all other similar controls (Nivo-Scroll).

If this feature is not there, is it possible to get a working example to use ScrollView with automatic scrolling and slowdown after page selection?

Best Regards
Maksim Bragin

Mihaela
Telerik team
 answered on 14 Nov 2023
0 answers
1.0K+ views
I noticed that if I attempt to add the .net core nuget package to a .net 8 project with entity framework core design package installed the add will fail as the Telerik package requires older libraries that the newer entity framework is not compatible with. The Telerik blog page indicates that the latest Telerik package is fully compatible with .net 8 and I dont believe that is accurate. Any idea when this will be fixed.
Lenny
Top achievements
Rank 1
 asked on 14 Nov 2023
1 answer
35 views

page:

var dataSource = new kendo.data.DataSource({
                type: "aspnetmvc-ajax",
                pageSize: 25000,
                serverPaging: false,
                serverGrouping: false,
                transport: {
                    read: {
                        url: urlRead,
                        data: kendo.antiForgeryTokens(),
                        type:"GET"
                    },

                    create: {
                        url: urlCreate,
                        data: kendo.antiForgeryTokens(),
                        cache: true,

                    },
                    update: {
                        url: urlUpdate,
                        data: kendo.antiForgeryTokens(),
                        cache: true,
                    },
                    destroy: {
                        url: urlDestroy,
                        data: kendo.antiForgeryTokens(),
                        cache: true
                    },

                    parameterMap: function (data, type) {
                        //if (type == "create") {
                        //    // send the created data items as the "models" service parameter encoded in JSON
                        //    return { models: kendo.stringify(data.models) };
                        //}
                    }

                },
                //requestStart: function() {
                //    kendo.ui.progress($("#"+gridName), true);
                //},
                //requestEnd: function() {
                //    kendo.ui.progress($("#"+gridName), false);
                //},
                sync: function (e) {


                },
                schema: {
                    data: "Data",
                    total: "Total",
                    errors: "Errors",
                    model: model,
                    errors: function (response) {
                        //ShowNotification(response);
                        return response.error;
                    }
                },
                error: function (e) {
                    //ShowNotification("Error");
                    dataSource.cancelChanges();
                }
            });
            //dataSource.bind("error", function () { ShowNotification("dsError") });

            grid.setOptions({
                dataSource: dataSource,
                persistSelection: true,
                navigatable: true,
                resizable:true,
                reorderable:true,
                dataBound: function (e) {
                    if (e.sender.dataSource.view().length > 0) {
                        e.sender.select("tr:eq(0)");
                        grid.trigger("change");
                        grid.unbind("dataBound");
                    }

                }
            });

backend: Controller

[HttpPost("AddCoatingType")]
        public ActionResult AddCoatingType(CoatingAgentType item,[DataSourceRequest] DataSourceRequest request )
        {
            try
            {
                //var experimentItemsView = ApplicationHelper.GetExperimentitems(AppConstant.ISTA, _ipConfig);
                //_coatingAgentTypeRepository.Insert(coatingAgentType);
                //await _coatingAgentTypeRepository.SaveAsync();
                //return new JsonResult(new[] { coatingAgentType }.ToDataSourceResult(request, ModelState));
                return new JsonResult("OK");

            }
            catch (Exception ex)
            {
                return this.StatusCode(StatusCodes.Status500InternalServerError, $"Error Info: {ex.Message}");
            }
        }                        
Mihaela
Telerik team
 answered on 13 Nov 2023
5 answers
1.5K+ views

I want to display a boolean value in an ASP.NET Core Kendo grid column. However, I need it to display a checkbox in the column because I don't want to show the users the raw data. So, I put in a custom client template because it's not an option to have booleans display a checkbox despite that seeming like an option that should be available by default. However, this grid is supposed to be editable inline using the default CRUD operations and you have to click on the cells to bring up the editor.

The default editor for a boolean column is a checkbox. So, the users click on a checkbox to bring up a different checkbox and it looks like it just didn't work. If I make the initial checkbox greyed out, it looks like they can't edit it. So, no matter what I do, I can't make a column a checkbox and use the default editor without a bunch of ugly design issues which is ridiculous.

Am I just missing something? Is there a better way than resorting to doing scripting with Javascript and setting the column to uneditable?

Maksim
Top achievements
Rank 1
Iron
 updated answer on 10 Nov 2023
1 answer
69 views

Using custom validity as below...

@(Html.Kendo()
                        .TextBoxFor(m => m.Task)
                        .Value(null)
                        .HtmlAttributes(new
                        {
                            required = "required",
                            oninvalid = "this.setCustomValidity('Enter a task')",
                            oninput = "this.setCustomValidity('')"
                        })
                        )

I've tried to do the same for other controls (numeric textbox, datetime picker, autocomplete) but it doesn't work.

For example, when trying the same thing for numeric textbox, in console I get an error "An invalid form control with name='Advance' is not focusable.

@(Html.Kendo()
                    .NumericTextBoxFor(m => m.Advance)
                    .Min(0).Max(1000)
                    .HtmlAttributes(new
                    {
                        id = "advance",
                        required = "required",
                        oninvalid = "this.setCustomValidity('Enter a number')",
                        oninput = "this.setCustomValidity('')",
                    })
                    )
Mihaela
Telerik team
 answered on 09 Nov 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?