Telerik Forums
UI for ASP.NET Core Forum
0 answers
2.7K+ 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
134 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
3.3K+ 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
181 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
1 answer
346 views

Hi,

I upgraded my asp.net mvc project to DotNet7 and updated Telerik to Progress® Telerik® UI for ASP.NET Core version 2023.3.1010, which is the latest. This Telerik package pulls in Microsoft.AspNetCore.Mvc.Core and Microsoft.AspNetCore.Mvc.Cors. Both these packages are depreciated and contain vulnerabilities as noted in CVE-2019-0548: https://msrc.microsoft.com/update-guide/en-US/advisory/CVE-2019-0548

Questions:
- Do you plan on removing the reference to the depreciated packages? Apparently everything is now included in the base aspnet SDK Microsoft.NET.Sdk.Web.

- Does using this package leave us vulnerable to the issue noted in the CVE?

Thanks!

Mihaela
Telerik team
 answered on 03 Nov 2023
0 answers
79 views

I'm having trouble setting the DateTimePicker to use the European style calendar (where weeks start on Monday) and a 24-hour time picker. Despite my attempts, I haven't been successful in achieving this configuration. I'm seeking guidance or a solution to implement this specific style for the DateTimePicker.

 
jess
Top achievements
Rank 1
 asked on 01 Nov 2023
1 answer
142 views
How to set DateTimePicker to use European style calendar (weeks start on Monday) and 24 hour time picker?
Alexander
Telerik team
 answered on 30 Oct 2023
1 answer
582 views

I have a listview that a user can click a button on and go to a new page.  I pass the current page and the id of the selected item to the new page.  When the user clicks on a link to return to the page with the listview, the page and the id are passed back.  I can change the page to the correct page and select the record in the dataBound event as shown below but, I have not been able to figure out how to scroll it into view.   Is there a way to do that?

function dataBound(e){
        var listViewDS = $("#lvDisplay").data("kendoListView").dataSource;
        var myPage = '@ViewBag.CurrentPage';
        var myId = '@ViewBag.CurrentId';

        if (myPage != 1){
            setTimeout(() => { listViewDS.page(myPage); }, 1000);

            var listView = $("#lvDisplay").data("kendoListView");
            var dataItems = listView.dataSource.view();
            var index = 0;
            for (var j = 0; j < dataItems.length; j++) {
                if (dataItems[j].Id == myId) {
                    index = j;
                    listView.select(index);

                    var row = e.sender.element.find("[data-uid='" + dataItems[j].uid + "']");
                    row.addClass("k-state-selected");
                };
            };
        }       
    }

I have tried the code below but always get an error for top.

$("#lvDisplay").scrollTop($("#lvDisplay").find(".k-state-selected").position().top);

 

 

 

__PRESENT__PRESENT__PRESENT__PRESENT__PRESENT__PRESENT__PRESENT

__PRESENT__PRESENT__PRESENT
Mihaela
Telerik team
 answered on 26 Oct 2023
1 answer
143 views

Good morning, I have the problem you see in the two images above, Is there anyone with the same problem who maybe solved it?
The problem appeared after updating from version 2022.2.802 to version 2023.2.829.
The two steppers are configured as follows:


@(Html.Kendo().Stepper()
    .Name("stepper")

        .Linear(false)
    .Orientation(StepperOrientationType.Horizontal)
    .Steps(s =>
    {
        for (int i = 0; i < (Model.ClaimStatusFlows.Count()); i++) {

            if (Model.Claim.ZQwaFlowStatus == Model.ClaimStatusFlows[i].IdQda)
            { selected = true;
                enabled = true;
            }
            else { selected = false; enabled = false;
            }
            s.Add().Label(Model.ClaimStatusFlows[i].Code).Selected(selected).Enabled(enabled);
        }

    }))


@(Html.Kendo().Stepper()
                                .Name("act_status")
                                .Indicator(false)
                                .Orientation(StepperOrientationType.Horizontal)
                                .Steps(s =>
                                {
                                    for (int i = 0; i < Model.ListActionStatus.Count(); i++)
                                    {
                                        if (Model.actions_status == Model.ListActionStatus[i].StatusValue)
                                        {
                                            s.Add().Label(Localizer[Model.ListActionStatus[i].StatusName].Value.ToString()).Selected(true).Enabled(true);
                                        }
                                        else
                                        {
                                            s.Add().Label(Localizer[Model.ListActionStatus[i].StatusName].Value.ToString()).Enabled(false);
                                        }
                                    }
                                })
                        )

and as additional css there are these two things:

    .k-step-text {
        max-width: 150% !important;
    }

    .k-step-label {
        max-width: 150% !important;
    }
I also tried to force the z-index of the k-step-indicators, but to no avail as it remains exactly the same.
Mihaela
Telerik team
 answered on 25 Oct 2023
1 answer
219 views

Hello,

I have the following grid implementation:

       <kendo-grid name="grid">
            <datasource type="DataSourceTagHelperType.Ajax" auto-sync="false" server-filtering="true" server-sorting="true" page-size="10">
                <transport>
                    <read url="@Url.Action("ReadItemList", "Users")" />
                </transport>
                <schema>
                    <model id="Id">
                        <fields>
                            <field name="UserName" type="string"><validation required="true"></validation></field>
                        </fields>
                    </model>
                </schema>
            </datasource>
            <groupable enabled="true" />
            <editable mode="inline" />
            <filterable enabled="true" />
            <sortable enabled="true" />
            <pageable button-count="5" refresh="true" page-sizes="new int[] { 5, 10, 20, 50, 100, 1000 }" />
            <columns>
                <column field="UserName" title="User name"></column>
            </columns>
        </kendo-grid>

My problem that the message shown is "UserName" is required", not "User name is required".

Mihaela
Telerik team
 answered on 20 Oct 2023
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?