Telerik Forums
UI for ASP.NET Core Forum
7 answers
229 views

I'm facing really strange behavior run core mvc app on Ipad chrome/edge browser on Ipad. This happen for all grids in the app. 

I get the following error:

kendo.all.js:67733 Uncaught TypeError: Cannot read property 'rows' of null  
at init._scrollable (kendo.all.js:67733)<br>   
at init._thead (kendo.all.js:69496)<br>   
at init._continueInit (kendo.all.js:63660)

...

 

I haven't at the moment touched any k-* styles for the grids.

The same grids work very fine in the desktop browsers (and in Ipad Safari).

FYI: The problem can be reproduced also using Edge development tools on desktop simulating mobile browser.

Any advise?

 

Tsvetomir
Telerik team
 answered on 20 Apr 2021
4 answers
647 views

Hi Progress,

Im currently trying to develop an grid view through your beautifully developed Kendo grid. 

The grid is displayed properly with the grid displaying the enum value as i wish. However i have stumbled upon a problem when using the GridEditMode.PopUp.

When pressing Add new Feature the option i can choose is the Enums key, not the value. My wish is to make an dropdown list of these enums for available features an user can choose from. And not the Key. 

I will supply my code here. 

@(Html.Kendo().Grid<X.Administration.UI.Models.FeaturesGridViewModel>
    ()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.Id).Hidden();
        columns.Bound(p => p.Tag);
    })
    .ToolBar(toolbar => toolbar.Create().Text("Add new feature"))
    .Editable(editable => editable.Mode(GridEditMode.PopUp))
    .Pageable()
    .Sortable()
    .Scrollable()
    .HtmlAttributes(new { style = "height:430px;" })
    .DataSource(dataSource => dataSource
    .Ajax()
    .PageSize(10)
    .Events(events => events.Error("error_handler"))
    .Model(model => model.Id(p => p.Id))
    .Read(read => read.Action("GetFeaturesByCarId", "Grid", new {id = @Model.Id}))
    .Update(update => update.Action("AddFeatureByVehicleId", "Feature", new { id = @Model.Id }))
    )
    )

Iv'e attached files displaying how it looks now, and what i wish for. My wish is to have an Html.Kendo().DropDownList() in my popup, when adding an entry. However i am not able to create one in my GridEditMode.PopUp. 

The result im looking for is similar to that of an Kendo drop down list. However iv'e been unable to locate an example in in the forums for ASP.NET CORE, using an dropdown of all available enums.

 

 

 

 

Mihaela
Telerik team
 answered on 19 Apr 2021
7 answers
1.5K+ views

Hello, im basically trying to do the Sorting/Paging/Filtering in my WebApi instead of the WebApp. 

Im trying to send the DataSourceRequest with a Http-Request to my WebAPI which works as long I dont add a filter. If I add a Filter I get the following error

Could not create an instance of type Telerik.DataSource.FilterDescriptor. Type is an interface or abstract class and cannot be instantiated.

 

If my DataSourceRequest does not contain a Filter (e.g just sortings) everything works perfectly.

How I send the DataSourceRequest to my WebAPI : 

var client = new RestClient($"{api.Address}:{api.Port}/api/v1");
var rr = new RestRequest("tmp/HelloWorld",Method.POST);
rr.AddHeader("Content-Type", "application/json; charset=utf-8");
rr.AddJsonBody(request); // Request is the DataSourceRequest that get passed to my Method
var result = client.Execute(rr, Method.POST);

 

My WebApi Function

public ActionResult<IEnumerable<TmpDTO>> HelloWorld([FromBody] DataSourceRequest request)
{
// do Something here
}

 

However my API never gets called when the DataSourceRequest contains a FilterDescriptor.

I saw a few threads (usually a few years old) and a few examples but I havent seen'n a single example on how to serialize the FilterDescriptors. Is this even possible? I just need the entire DataSourceRequest in my WebAPI

 

Thanks in advance. 

Neli
Telerik team
 answered on 16 Apr 2021
3 answers
196 views

I am trying to use a ViewComponent to encapsulate a simple dataset using a pager and datasource.  Using the example from https://demos.telerik.com/aspnet-core/pager , I can get the example to work directly in a Razor page.  When wrapped in a ViewComponent, the script for the DataSource is never rendered.  This appears to be a server-side rendering issue, as the <script>dataSource1=....</script> is never rendered.  Also, when doing similar example for Grid and ListView, they work fine.

Should pager and dataSource work in a viewComponent?  Maybe I missed something.

Eyup
Telerik team
 answered on 16 Apr 2021
4 answers
246 views
I want to use the calendar to display multiple dates that have an event occurrence but I do not want the user to be able to select any dates.  Is there a way to make the calendar read only or disabled?
Mihaela
Telerik team
 answered on 16 Apr 2021
7 answers
609 views

Hi there,

I'm having an issue getting the grid with client detail template to work.

<div class="row mt-3 mb-2">
    <div class="form-group col-md-12 ">
        @(Html.Kendo().Grid(Model)
            .Name("ConditionAssessmentGrid")
            .Columns(columns =>
            {
                columns.Bound(p => p.ConditionAssessmentYear);
                columns.Bound(p => p.ConditionAssessmentId).Title("Actions").Width(100)
                    .ClientTemplate("<div class='btn-group grid-commands' role='group'>" +
                        "<a href='/Sites/ConditionAssessment/ConditionAssessment/Summary/#=ConditionAssessmentId#' class='btn btn-primary btn-sm mr-2'><i class='fas fa-eye'></i> View</a>");
            })
            .Sortable()
            .ClientDetailTemplateId("conditionassessmentemplate")
            .NoRecords(n => n.Template("<span class='mt-3 mb-3 col-md-12 text-left'>No data exists</span>"))
            .Pageable(p => p.Enabled(false))
            .DataSource(dataSource => dataSource
                .Ajax()
                .ServerOperation(false)
            )
        )
 
        @Html.AntiForgeryToken()
 
        <script id="conditionassessmentemplate" type="text/kendo-tmpl">
 
            @(Html.Kendo().Grid<ProtectedSites.ViewModel.ConditionAssessment.ConditionAssessmentGridViewModel>()
                 .Name("grid_#=ConditionAssessmentId#")
                 .Columns(columns =>
                 {
                     columns.Bound(p => p.FeatureInstance.FeatureName).Title("Feature");
                     columns.Bound(p => p.DateCreated).Title("Date created").Format("{0:dd/MM/yyyy}");
                     columns.Bound(p => p.CreatedUser).Title("Created by");
                     columns.Bound(p => p.LatestMonitoringDate).Format("{0:dd/MM/yyyy}").Title("Latest monitoring date");
                     columns.Bound(p => p.LatestMonitoringLevelOneResult).Title("Condition assessment 1");
                     columns.Bound(p => p.LatestMonitoringLevelTwoResult).Title("Condition assessment 2");
                 })
                 .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(5)
                    .Read(read => read.Action("GetFeatureInstances", "ConditionAssessment", new { siteid = ViewContext.RouteData.Values["SiteId"], conditionAssessmentId = "#=ConditionAssessmentId#" }))
                )
                .Pageable()
                .Sortable()
                .ToClientTemplate()
            )
        </script>
 
    </div>
</div>

 

My Parent grid model and child grid model both have a property named ConditionAssessmentId. However, when expanding the detail template, the read action always fails with the following error:

Uncaught ReferenceError: conditionassessmentid is not defined
    at Object.eval [as tmpl0] (eval at compile (kendo.all.js:234), <anonymous>:3:1645)
    at Object.eval (eval at compile (kendo.all.js:234), <anonymous>:3:185)
    at proxy (jquery.js:10771)
    at init._toggleDetails (kendo.all.js:69238)
    at HTMLAnchorElement.<anonymous> (kendo.all.js:69226)
    at HTMLTableElement.dispatch (jquery.js:5429)
    at HTMLTableElement.elemData.handle (jquery.js:5233)

 

I do note that it does correctly resolve the same binding expression in the Name property of the child grid, just not for the Read event.

Am I doing something obvious wrong here? I've referred to your DetailTemplate example and can't see anything I am doing differently.

Thanks,

Paul

Georgi Denchev
Telerik team
 answered on 15 Apr 2021
2 answers
374 views

When using clasic ASP.NET Core approach user can define custom editor template like this:

f.Add(p=>p.CategoryID).Label("Category").DefaultValue(1).EditorTemplateHandler("categoryDropDownEditor");
function categoryDropDownEditor(container, options) {
        $('<input data-bind="value: value" name="' + options.field + '"/>')
            .appendTo(container)
            .kendoDropDownList({
                dataTextField: "CategoryName",
                dataValueField: "CategoryID",
                dataSource: {
                    type: "odata",
                    transport: {
                        read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Categories"
                    }
                }
            });
    }

 

Is this possible to achieve using Tag helpers and is there any way to pass the parameter/s to the categoryDropDownEditor function?

Dubravko
Top achievements
Rank 1
 answered on 13 Apr 2021
3 answers
320 views

Hello,

I have multiple grids inside Panelbar, for some reason filter popup window doesn't show up in the usual place (below filter icon) but right in the middle or in extreme cases even at the top of the window.

Thanks.

Tsvetomir
Telerik team
 answered on 13 Apr 2021
1 answer
107 views

Dear,

I want to Add dynamic & cascade dropdown in filter control in .NET CORE but current it allows only one dropdown in Filter Field. 

Below is the screen shot attached "Payout Rule - 6.png" what actually I want to achieve. Is there any way to customize this control in .NET CORE so kindly share. 

Tsvetomir
Telerik team
 answered on 13 Apr 2021
5 answers
1.5K+ views

Hello,

 

I've done some searching  and can't find an example of this, so I'm asking here...

I have a grid that I'm using as part of a process to build a parent with child objects.  Think Order (as the parent) and Products (as the children).  Each parent has one or more children.

 

I create the parent object, and then 'Add' children to it, one at a time.  This part works great.

I would like to be able to upload a file as part of the process or creating a child.  I only need to upload one file at a time, and only when I create the child.  

I'm using Asp.Net core 2.0, with Telerik UI version 2017.3.1206.

 

I don't have a small project to demonstrate this; I could build one if I needed to, but it would take a bit.  I'm  just hoping for some pointers to documentation, or examples.  

 

Thanks!

Phil

Eyup
Telerik team
 answered on 12 Apr 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?