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

I am getting loading error when using aspnet Core grid with dynamic columns and Filterable option. The grid is loading fine when the Filterable option is not configured. Also, events are not working properly. I am using 2024.4.1112 version.

Here is sample code

 @(
     Html.Kendo().Grid<dynamic>()
     .Name(Model.GridId)
     .Columns(columns =>
     {
         foreach (var col in Model.Columns)
         {
             var kendoColumn = columns.Bound(col.PropertyName);
             kendoColumn.Title(col.Title);
             kendoColumn.Width(col.Width);
             kendoColumn.Filterable(col.Filterable);
             if (!string.IsNullOrEmpty(col.Format))
             {
                 kendoColumn.Format(col.Format);
             }
             if (!string.IsNullOrEmpty(col.Template))
             {
                 kendoColumn.ClientTemplate(col.Template);
             }
             if (col.DataType == "boolean")
             {
                 kendoColumn.HtmlAttributes(new { style = "text-align:center" });
             }
         }
     })
     .Pageable(p =>
     {
         p.ButtonCount(10);
         p.PageSizes(true);
         p.Refresh(true);
     })
     .Filterable(f => f.Mode(GridFilterMode.Menu))
     .Sortable()
     .ColumnMenu(c =>c.Filterable(true))
     .Reorderable(r => r.Columns(true))
     .Resizable(r => r.Columns(true))
     .DataSource(dataSource => dataSource
     .Ajax()
     .Read(read => read.Action("Entity", "History", new { entityName = Model.EntityName, pkValue = Model.PrimaryKeyValue, entityType = Model.EntityType, pkName = Model.PrimaryKeyName }))
     )
     .Events(e => e.Change("ob-select"))
     )
Mihaela
Telerik team
 answered on 19 Mar 2025
1 answer
63 views

I am encountering an issue while integrating a Kendo Grid within a TabStrip. Whenever I attempt to add the Grid, I receive the attached error(image.png) in the browser console:  Uncaught Error: Invalid template.

Below is the code I am trying to put inside TabStrip. Not sure Please let me know what the mistake I am doing. 

 <div id="divEquipmentDetailsGrid" >
     @(Html.Kendo().Grid<EPP.Core.DTOs.UserEqupmentDetailsDTO>(Model.UserEquipDetails)
                     .Name("EquipmentDetailsGrid")
                     .Columns(columns =>
                     {
                         columns.Bound(p => p.EquipmentName).Title("ss");
                         columns.Bound(p => p.AssertTag).Width(130).Title("tt");
                         columns.Bound(p => p.Accessories).Width(130).Title("rr");
                     })
                 )
 </div>

If I remove the above code I am able to see tabs and data inside the tabs but When I add above code, nothing is displaying and getting error.

 

I am attaching full code cshtml file.

Justin
Telerik team
 answered on 13 Mar 2025
1 answer
32 views

I currently have the grid below. And I am trying to make a different popup for when someone is creating a new entry vs editing the existing one. Mainly to show different fields and such. How do I go about doing so?

Whether I click on the Create() on the AddNewRecord or the edit, it hits the Edit() event or BeforeEdit() when I switch to that so they end up calling the same Javascript function. And within that function I cant seem to find a way to determine which button was pressed. On here I can only find this reference: Custom Popup Editor for Create and Edit in UI for ASP.NET Core | Telerik Forums , but it doesnt use the same syntax.

                            <div id="minutesDiv">
                                @Html.Kendo().Grid(Model.MinutesList).Name("MinutesGrid").Size(ComponentSize.Small).Editable(GridEditMode.PopUp).Resizable(r => r.Columns(true)).ToolBar(x =>
                                     {
                                         x.Create();
                             }).Columns(col =>
                                     {
                                         col.Bound(c => c.MinuteDate).Title("Date Created").Width(100);
                                         col.Bound(c => c.CreatedBy).Title("Entered By").Width(200);
                                         col.Bound(c => c.Minute).Title("Minutes").Width(200);
                                         col.Command(c =>
                                         {
                                             c.Edit();
                                             c.Destroy();
                                         }).Width(170);
                                     }).Events(e => 
                                         {
                                             e.Edit("HideFieldsOnEdit");
                                         }).Sortable().DataSource(dataSource => dataSource
                                     .Ajax()
                                     .Read(r => r.Url("/Appearances/OutcomeInformation?handler=Read").Data("forgeryToken"))
                                     .Update(r => r.Url("/Appearances/OutcomeInformation?handler=Update").Data("forgeryToken"))
                                     .Create(r => r.Url("/Appearances/OutcomeInformation?handler=Create").Data("forgeryToken"))
                                     .Destroy(r => r.Url("/Appearances/OutcomeInformation?handler=Destroy").Data("forgeryToken"))
                                     .Model(model =>
                                     {
                                         model.Field(Field => Field.MinuteDate);
                                         model.Field(Field => Field.CreatedBy);
                                         model.Field(Field => Field.Minute);
                                     }))
                            </div>



                function HideFieldsOnEdit(e){
                    e.container.find("#MinuteID").hide();
                    e.container.find("label[for='MinuteID']").hide();
                    e.container.find("#CreatedBy").hide();
                    e.container.find("label[for='CreatedBy']").hide();
                    e.container.find("#MinuteDate").hide();
                    e.container.find("label[for='MinuteDate']").hide();   
                    e.container.find("#FileID").hide();
                    e.container.find("label[for='FileID']").hide();
                }

Eyup
Telerik team
 answered on 07 Mar 2025
1 answer
47 views

Environment Info: ASP for .Net Core, taghelper kendo-grid

I have defined a template for a kendo grid popup editor. 

<editable mode="popup" template-id="popup-editor">
    <editable-window title="Add/Edit Collateral"/>
</editable>

This is the template

@using Kendo.Mvc.UI

@addTagHelper *, Kendo.Mvc

@model MyApp.Web.ViewModels.MyViewModel

<div id="divEditImpliedSupport">
<form method="post" id="frmImpliedSupport" asp-action="SaveImpliedSupport" asp-controller="ReviewApi">
<input type="hidden" asp-for="CollateralID" />
<div class="row">
<div>
<formgroup>
<formlabel asp-for="CollateralDescription" ></formlabel>
<div>
<forminput asp-for="CollateralDescription" style="width:400px;"></forminput>
</div>
</formgroup>
</div>
</div>
</form>
</div>

 

How do I set the size of the popup window?

 

Eyup
Telerik team
 answered on 05 Mar 2025
2 answers
50 views

Hello,

I can't seem to find a component for asp.net core that will just rotate images on a home page for example. Am I missing something? What component will do this?

Thanks

Anton Mironov
Telerik team
 answered on 05 Mar 2025
1 answer
53 views

Hi

I have a form component, and ideally I'd like to embed some custom HTML within it alongside one of the fields.

For example pseudo code for if this sort of thing was possible :

items.Add()
.Field(f => f.Task.StartDate)
.Label(l => l.Text("Call Date"))
.Editor(e =>
{
	e.DateTimePicker()
	.Size(ComponentSize.Small)
	.Format("{0:dd/MM/yyyy HH:mm}")
	.Min(DateTime.Now)
	.DateInput();
});

items.Add()
.ClientTemplate(<ul><li><a href="test1">A Link</a></li><li><a href="test2">Another Link</a></li></ul>);
How do I achieve injecting my own HTML into the form layout please?
Mihaela
Telerik team
 answered on 03 Mar 2025
0 answers
36 views

Hi support team,

 

sadly, we ran out of support so I'll try the forum for help.

 

We have bound column

 


   columns.Bound(c => c.BusinessPartner.Name).Title("Customer").Groupable(true)
       .Filterable(f => f.Multi(false).Search(true).Cell(c => c.ShowOperators(false).Operator("startswith"))).Width(250)
       .ClientTemplate(@"
           #= data.BusinessPartner.Number # #= data.BusinessPartner.Name #
           #if (data.BusinessPartner.PostalAddress != null) {#
               <span class='d-flex'> (#= data.BusinessPartner.PostalAddress.City #)</span>
           #}#");

 

From now on the filter using "startswith" is broken. Let me explain. Yesterday when entering "e" it displays all customers starting with "e". But suddenly some customers are not shown any more. Yesterday the list contained two entries and today only 1 entry any more.

I examined the SQL query behind the scenes but this is ok.

What could be wrong here?

Stefan
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 25 Feb 2025
1 answer
38 views

I'm using a grid with filter multi checkboxes. I created a custom download for version 2025.1.211 with the Editing, Filtering, Row filter, and Paging  grid options checked.

When the filter button is clicked, the filter window is cut off by the 2nd row in the grid.

If I change the layout to reference kendo.all.min.js instead of kendo.custom.min.js it works fine. Is there a dependency for the row filter that is not being automatically checked?

Thank you

Anton Mironov
Telerik team
 answered on 24 Feb 2025
2 answers
37 views

When using the orgchart for a large set of nodes (2000+) it can be cumbersome to find where you are when a node is expanded. Is there a way to keep the just expanded node selected?

I've added an event handled to the Expand event which is called correct.


<script>
    function onExpand(e) {
//        alert("event: Expand --> " + e.dataItems[0].title + " expanded");
        alert(e.dataItems[0].id);
        var orgChart = $("orgChart").getKendoOrgChart();
        orgChart.select(e.dataItems[0]);
    }    
</script>

 

The alert fires with the correct id but dosen't seem to select the node that was clicked. I'd like to have that selected so the end user doesn't lose their place as the orgchart expands. Thanks!

 

Ivaylo
Telerik team
 answered on 20 Feb 2025
1 answer
31 views

Hi,

We're using the org chart component and the data binding works great and we love the template capabilty. But the org only uses a portion of the width of the display and as we have a large organization it would be better if it could use the full amount. I tried this:

.HtmlAttributes(new {style="width:100%"})

but it didn't seem to change anything. What am I missing on this? Thanks!

Ivan Danchev
Telerik team
 answered on 19 Feb 2025
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?