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

HI
I added the search with filter="FilterType.Contains" to the dropdowntree-editor control

Now if I select the parent checkbox, the children are no longer automatically selected.
How can I do?
Thank you

 


  <form-item field="Destinatari" col-span="1">
                                <item-label text="Destinatari (attivi con capacità espositiva):" optional="false" />
                            <dropdowntree-editor LoadOnDemand="false" name="dropdowntree_Destinatari" auto-close="false" dataspritecssclassfield="spriteCssClass" value-template-id="dropdowntree-value-template" template-id="dropdowntree-template"
                                                 datatextfield="text"
                                                 filter="FilterType.Contains"
                                                style="width: 100%" >
                                <hierarchical-datasource>
                                    <schema>
                                        <hierarchical-model id="id"></hierarchical-model>
                                    </schema>
                                    <transport>
                                            <read url="@Url.Action("Items_GetDestinatari", "FormCampagna")"  />
                                    </transport>
                                </hierarchical-datasource>
                                <checkboxes check-children="true"  enabled="true" />
                                </dropdown

Alexander
Telerik team
 answered on 12 Apr 2023
1 answer
232 views

I am trying to implement the Hierarchy with asp.net core razor grid. The child detail rows are not coming up. Can you please help me with this issue

@(Html.Kendo().Grid < Orders.Models.Case>
                                ().Name("grid")
                                //.Groupable()
                                .Sortable()
                                .Scrollable()
                                .Filterable()
                                 .ToolBar(t => t.Search())
                                 .Resizable(resize => resize.Columns(true))
                                //.ToolBar(x => x.Create())
                                .Columns(columns =>
                                {

                                    columns.Bound(column => column.EmpId).Stickable(true);
                                    columns.Bound(column => column.Name);
                                    columns.Bound(column => column.Type);

                                    //columns.Command(column =>
                                    //{
                                    //    column.Edit();
                                    //    column.Destroy();
                                    //}).Width(230);
                                })
                                .ToolBar(tools => tools.Excel()).Excel(excel => excel.FileName("cases.xlsx"))
                                .Excel(excel => excel.AllPages(true))
                                 .Reorderable(reorder => reorder.Rows(true).Columns(true))
                                .DataSource(ds => ds.Ajax()
                                .Read(r => r.Url("/Index?handler=Read").Data("forgeryToken"))
                                .ServerOperation(false)
                             
                                .PageSize(10)
                                )
                                .Pageable()
                                .Pageable(pageable => pageable.PageSizes(new int[] { 5, 10, 20, 100 }))
                                .ClientDetailTemplateId("template")
)

<script>
    function forgeryToken() {
        return kendo.antiForgeryTokens();
    }
</script>

<script id="template" type="text/kendo-tmpl">
            @(Html.Kendo().Grid<CobbJudicialRecordsSrch.Models.CaseOffenses>()
                    .Name("grid_#=CaseId#") // template expression, to be evaluated in the master context
                    .Columns(columns =>
                    {
                        columns.Bound(o => o.OrderId).Width(110);
                        columns.Bound(o => o.OrderDescription).Width(150);
                        columns.Bound(o => o.OrderName).Width(150);

                        //columns.Bound(o => o.Dispositon).ClientTemplate("\\#= ShipAddress \\#"); // escaped template expression, to be evaluated in the child/detail context
                        //columns.Bound(o => o.ShipName).Width(300);
                    })
                    .DataSource(dataSource => dataSource
                        .Ajax()
                        .PageSize(10)
                         .Read(read => read.Action("HierarchyBinding_Orders", "Grid", new { employeeID = "#=empId#" }))
                    )
                    .Pageable()
                    .Sortable()
                    .ToClientTemplate()
            )
</script>
<script>
    function dataBound() {
        this.expandRow(this.tbody.find("tr.k-master-row").first());
    }
</script>

 

 

Alexander
Telerik team
 answered on 11 Apr 2023
0 answers
130 views

With this example, it appears the filter on the OrderDate will only filter on the data that was loaded into the grid initially, correct?   In other words, could the OrderDate range be expanded to return more data ?  

https://demos.telerik.com/aspnet-mvc/grid/remote-data-binding

If one has several thousand rows to potentially pull in, we will likely need to:
- Set AutoBind to false
- Provide some parameter values to pass in via the Data method to limit the results.

Blazor
Top achievements
Rank 1
Iron
 asked on 05 Apr 2023
1 answer
1.6K+ views

I am getting an error "Sorry, the page you are looking for is currently unavailable." from your CDN loading css example:

https://kendo.cdn.telerik.com/2023.1.314/styles/kendo.bootstrap-v4.min.css

JavaScript works fine though:

https://kendo.cdn.telerik.com/2023.1.314/js/jquery.min.js

Is there a general rule of what cdn url to use?, I did put in a suggestion a while ago which got rejected would be handy if this was added:

    @{
        var version = typeof(Kendo.Mvc.KendoServices).Assembly.GetName().Version;
        string kendoCDN = $"//kendo.cdn.telerik.com/{version.Major}.{version.Minor}.{version.Build}";
    }
    <link href="@Url.Content(kendoCDN + "/styles/kendo.bootstrap-v4.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content(kendoCDN + "/styles/kendo.common-material.min.css")" rel="stylesheet" />
    <link href="@Url.Content(kendoCDN + "/styles/kendo.rtl.min.css")" rel="stylesheet" />
    <link href="@Url.Content(kendoCDN + "/styles/kendo.material.min.css")" rel="stylesheet" />
    <link href="@Url.Content(kendoCDN + "/styles/kendo.material.mobile.min.css")" rel="stylesheet" />


    <script src="@Url.Content(kendoCDN + "/js/jquery.min.js")"></script>
    <script src="@Url.Content(kendoCDN + "/js/jszip.min.js")"></script>
    <script src="@Url.Content(kendoCDN + "/js/kendo.all.min.js")"></script>
    <script src="@Url.Content(kendoCDN + "/js/kendo.aspnetmvc.min.js")"></script>
    <script src="@Url.Content(kendoCDN + "/js/kendo.timezones.min.js")"></script>

Chris

Aleksandar
Telerik team
 answered on 05 Apr 2023
2 answers
1.6K+ views

Hi,

I have a Kendo grid setup and I would like my controller's update action to assign a custom error to the ModelState and have that picked up on the client side. This is not an actual error, but more of a flag I can catch on the client side to initiate a redirect to another page (similar to the concept posted here: Redirect to another page after update in Kendo grid with inline edit in UI for ASP.NET MVC | Telerik Forums

My issue is that I cannot get the error handler to fire on the client side. Here is my controller action (I've reduced it down to just the error handling for simplicity):

[HttpPost]
 public JsonResult Status_Update([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")] IEnumerable<StatusViewModel> changedEntries)
 {
     ModelState.AddModelError("UserRedirect", "UserRedirect needed");
     var result = ModelState.ToDataSourceResult();
     return Json(result);
 }

 

Here is my grid setup:


@(Html.Kendo().Grid(Model)
            .Name("status-grid")
            .Columns(c =>
            {
              // snip column setup
            })
            .ToolBar(toolbar =>
            {
                toolbar.Custom().Text("Save changes and submit").HtmlAttributes(new { id = "saveButton" });
            })
            .Editable(editable => editable.Mode(GridEditMode.InCell))
            .Scrollable(s => s.Height(850))
            .Navigatable()
            .Events(events =>
            {
                events.Edit("onEdit");
                events.Navigate("onNavigate");
            })
            .DataSource(dataSource => dataSource
                .Ajax()
                .Batch(true)
                .ServerOperation(false)
                .Events(events => events.Error("onError"))
                .Model(model =>
                {
                    // snip model fields
                })
                .Update("Status_Update", "Status"))
            )

 

Finally, here is my error handler function:


<script type="text/javascript">
    function onError(e) {
        alert("Error handler fired");
    }
</script>

 

I feel like this is a pretty vanilla setup, so I'm not sure why it isn't working. I've tried quite a few variations and the error handler never executes. I have no errors in the console. Here is the JSON that is being received on the client side. Can anyone see anything I am doing wrong, or tell me a better way to redirect the user to another page after the AJAX Update action finishes running? Thanks!!


{errors: {ValidationRedirect: {errors: ["ValidationRedirect needed"]}}}
errors: {ValidationRedirect: {errors: ["ValidationRedirect needed"]}}
ValidationRedirect: {errors: ["ValidationRedirect needed"]}
errors: ["ValidationRedirect needed"]
0: "ValidationRedirect needed"

Stoyan
Telerik team
 updated answer on 04 Apr 2023
1 answer
209 views

Hello,

The change event of the Grid not working in version 2022.3.1109

Not working when selectable set mode Single and type row.

.Selectable(selectable => selectable.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))

 

Thanks.

Mihaela
Telerik team
 answered on 04 Apr 2023
1 answer
110 views
Is it possible to add a Year View or some sort of project wide scaled view to the timeline?  We often have long projects and would like to scale the timeline to show the entire project in the window both for web use and for pdf export.
Aleksandar
Telerik team
 answered on 04 Apr 2023
1 answer
177 views

(Edited- pivoted back to using [Remote] validation, but need to figure out how to keep popup in place after ModelState validation failure if user clicks submit)

Hi all,

I am working on a PopUp Editor for a Grid widget that displays user account information.  The PopUp Editor is a custom template, and has Telerik TextBox widgets for the user account's data, including UserName.  We want to validate the UserName by making a clientside call to the server to see if the UserName is already in use.

I am using  [Remote] validation in our view model that makes a call from the clientside to a method in our controller that checks if the UserName is already in use.  As has been the case with other people, this call is made even if a user clicks through the UserName Textbox and doesn't change the value for UserName, but our use case is such that I can work around this issue.

The problem is that if a user changes the username to an existing username, the Remote validation fires, but does not prevent the user from clicking Update on the PopUp- the user can click Update.  On the server side, the Update will fail due to ModelState.IsValid = false, and a failure message is returned, but the user is not notified of the failure- the PopUp just fades out.  If the user clicks "Edit" again, the username has the updated value in the PopUp, even though the update failed.

I was expecting that if the user clicks Submit, then the failure message that's returned would be displayed, and the PopUp would not fade out.   I suspect it may have to do with using an custom Editor Template,  but I'm hoping somebody can point out whatever it is I might be missing.

I used the following as guides:

Has anybody been successful in using a custom template for PopUpEditor on a Grid, with a [Remote] validation, with the returned ModelState errors preventing the PopUpEditor from disappearing, instead displaying the returned error(s)?

Thanks in advance!

Taylor

Alexander
Telerik team
 answered on 03 Apr 2023
1 answer
3.5K+ views

Hi,

I am using System.Text.Json and Kendo UI in a .NET Core 6.0 project. I have followed this article in order to solve the property name casing issue: https://docs.telerik.com/aspnet-core/installation/json-serialization.

However, I am also using a JsonStringEnumConverter as follows:

c.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());


.AddJsonOptions(c =>
{
      c.JsonSerializerOptions.PropertyNamingPolicy = null;
      c.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
      c.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull;
})

This results in all enums being serialised as null in grids when read using an Ajax DataSource call. How can I get Kendo to serialise enums as strings?

Kind regards,

David 

Aleksandar
Telerik team
 answered on 03 Apr 2023
0 answers
306 views

So now there is R1 2023.

how can i prevent Localization folders to be copied to publish folder ?

im using Telerik.UI.for.AspNet.Core 2023.1.314

 

Regards

NoobMaster

NoobMaster
Top achievements
Rank 2
Iron
 asked on 03 Apr 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?