Telerik Forums
UI for ASP.NET Core Forum
9 answers
123 views

Hi I have the code and result below, but Auto Complete show not fund any thing i missing or got it wrong here?

@(Html.Kendo().AutoComplete()
.Name("ceaSearch")
.HtmlAttributes(new { style = "width:100%" })
.DataTextField("salesperson_name")
.MinLength(1)
.DataSource(source =>{
    source.Read(read =>
    {
        read.Url("https://data.gov.sg/api/action/datastore_search")
        .Data("getCEAData");
    })
    .ServerFiltering(true)
    .Custom()
    .Schema(schema => schema
        .Data("records")
        .Type("json")
        .Model(model =>
        {
            model.Id("salesperson_nam");
            model.Field("registration_no", typeof(string));
            model.Field("estate_agent_name", typeof(string));
            model.Field("estate_agent_license_no", typeof(string));
        })
    );
}).Template("<span>#: records.salesperson_name#</span>"))

 

 

function getCEAData() {

    var value = $("#ceaSearch").data("kendoAutoComplete").value();
    return {
        resource_id: 'a41ce851-728e-4d65-8dc5-e0515a01ff31', // the resource id
        q: value
    };
}

 

The API returned data below. but Autocomplate show not found

 

{"help": "https://data.gov.sg/api/3/action/help_show?name=datastore_search", "success": true, "result": {"resource_id": "a41ce851-728e-4d65-8dc5-e0515a01ff31", "fields": [{"type": "int4", "id": "_id"}, {"type": "text", "id": "salesperson_name"}, {"type": "text", "id": "registration_no"}, {"type": "text", "id": "registration_start_date"}, {"type": "text", "id": "registration_end_date"}, {"type": "text", "id": "estate_agent_name"}, {"type": "text", "id": "estate_agent_license_no"}, {"type": "int8", "id": "_full_count"}, {"type": "float4", "id": "rank"}], "q": "merita", "records": [{"registration_end_date": "2019-12-31", "estate_agent_license_no": "L3008536D", "salesperson_name": "MERITA LOUISE TIN GUEK PING (DENG YUEPING) (MERITA LOUISE TIN)", "registration_no": "R000662B", "rank": 0.0706241, "_full_count": "2", "registration_start_date": "2015-11-03", "estate_agent_name": "LANDPLUS PROPERTY NETWORK PTE LTD", "_id": 30808}, {"registration_end_date": "2019-12-31", "estate_agent_license_no": "L3008536D", "salesperson_name": "MERITA LOUISE TIN GUEK PING (DENG YUEPING) (MERITA LOUISE TIN)", "registration_no": "R000662B", "rank": 0.0706241, "_full_count": "2", "registration_start_date": "2015-11-03", "estate_agent_name": "LANDPLUS PROPERTY NETWORK PTE LTD", "_id": 32886}], "_links": {"start": "/api/action/datastore_search?q=merita&resource_id=a41ce851-728e-4d65-8dc5-e0515a01ff31", "next": "/api/action/datastore_search?q=merita&offset=100&resource_id=a41ce851-728e-4d65-8dc5-e0515a01ff31"}, "total": 2}}

Ivan Danchev
Telerik team
 answered on 29 Aug 2019
1 answer
329 views

Telerik UI for ASP.NET Core not working on Razor page Core 2.0

To replicate:

Create New Project -> .NET Core -> ASP.NET Core Web Application

Select -> Web Application (ASP.NET Core 2.0)

Added services.AddKendo(); to Startup.cs

Added @addTagHelper, etc .  to _ViewImports.cshtml

Added link and script to _Layout.cshtml

Added @using Kendo.Mvc.UI and @(Html.Kendo().DatePicker().Name("my-picker")) to target page.

Encountered error showed in title. 

Nikolay
Telerik team
 answered on 28 Aug 2019
3 answers
1.6K+ views

I am using the example from: https://demos.telerik.com/aspnet-core/pdfviewer/index

No matter what PDF file I put in the code I get the message "PDF file fails to process".  If I use the dialog on the PDF Viewer and go to the exact same PDF file it opens correctly.  Any idea what I am missing?

From Layout.cshtml:

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - TestPDFApp</title>
    <script src="~/js/site.js"></script>
    <script src="https://kendo.cdn.telerik.com/2019.2.619/js/jquery.min.js"></script>
    <script src="https://kendo.cdn.telerik.com/2019.2.619/js/jszip.min.js"></script>
    <script src="https://kendo.cdn.telerik.com/2019.2.619/js/kendo.all.min.js"></script>
    <script src="https://kendo.cdn.telerik.com/2019.2.619/js/kendo.aspnetmvc.min.js"></script>
    <script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
    <link rel="stylesheet" href="~/lib/kendo-ui/styles/kendo.common.min.css" />
    <link rel="stylesheet" href="~/lib/kendo-ui/styles/kendo.rtl.min.css" />
    <link rel="stylesheet" href="~/lib/kendo-ui/styles/kendo.bootstrap.min.css" />
    <link href="~/css/site.css" rel="stylesheet" />
</head>

 

From my View:

<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.js"></script>
<script>
    window.pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.worker.js';
</script>
<div id="example">
    @(Html.Kendo().PDFViewer().Name("pdfviewer")
                //.PdfjsProcessing(pdf => pdf.File(Url.Content("~/wwwroot/PDF/Issue Definitions.pdf")))
                .PdfjsProcessing(pdf => pdf.File(Url.Content("https://demos.telerik.com/kendo-ui/content/web/pdfViewer/sample.pdf")))
                .Height(1200)
    )
</div>
<style>
    html body #pdfviewer {
        width: 100% !important;
    }
</style>

Petar
Telerik team
 answered on 27 Aug 2019
2 answers
119 views

Is there a way to make a column cell in the grid editable when the user clicks the create button on the toolbar but to make the same column cell read only when the user tries to edit the record?  I want the user to be able to add new records but not be able to change the values in a specific field when editing the row.

I can use the beforeEdit function to determine if it is in new or update state but not sure what to do from here.

function beforeEdit(e) {
        if (!e.model.isNew()) {
            alert("Edit");
        }
        else {
            alert("New");
        }
    }

I am using Visual Studio 2017, Net Core 2.1 Telerik 2019.2.619

Thanks.

Rich

Nikolay
Telerik team
 answered on 26 Aug 2019
7 answers
3.3K+ views

I have an angular grid which uses a GridDataResult posting back to an API controller in my .netcore project with a DataSourceRequest parameter.

The first column of my grid has a Guid, declared in a model both server and client side.

When I try filter on this column the server throws an exception:

"Provided expression should have string type".

I have searched both this forum and the MVC forum to try apply a server-side request filter to no avail.

How should this be handled?

Daniel Blendea
Top achievements
Rank 1
 answered on 23 Aug 2019
2 answers
820 views

Hi,

I'm trying to use the Grid inTelerik UI for ASP.NET Core with a remote datasource:

@(Html.Kendo().Grid<DashboardEntry>()
.Name("dashboardGrid")
.Columns(columns =>
{

columns.Bound(p => p.Id).Width(50);
  columns.Bound(p => p.State).Width(100); --> Enum property

})
.AutoBind(false)
.DataSource(dataSource =>
dataSource
.Ajax()
.ServerOperation(true)
.Batch(true)
.PageSize(20)
.Model(model => model.Id(p => p.Id))
.Read(read =>
read.Url("http://localhost:5000/dashboard/entries")
.Type(HttpVerbs.Get))
.Events(events => events.Error("error_handler"))
)
)

The json from server looks like this:

{

Data:[

{0: {Id: 22041, State: "Draft" },

{0: {Id: 22042, State: "Complete" }

],

Total: 2

}

Practically, the enum is actually a string, thanks to a StateConverter : JsonConverter.

But nothing is rendered/displayed in the State column.

How can I make it work?

Thanks.

Daniel Blendea
Top achievements
Rank 1
 answered on 22 Aug 2019
2 answers
141 views

If I have things set up for inline editing and I click on the add button on the toolbar and create my new item, all is well.
The problem crops up when, immediately after saving the new item, I then click on teh edit button for that item. It then correctly opens up the line to make changes,
but you hit update you're create function gets called instead of the update function. Thus I end up with duplicates.

Thanks … Ed

 


Viktor Tachev
Telerik team
 answered on 21 Aug 2019
5 answers
658 views

In scheduler control, I can create a date like Aug 11 8am.
The view model saves the date as UTC :  start = new DateTime(value.Ticks, DateTimeKind.Utc);  
On the Server , I see a -7 hour offset , like Aug 11 1am.
----------------------------------------------------------------------
This wiki says "SchedulerEvent instances are created, where start/end dates are instantiated as JavaScript Date objects. During the process the dates will be offset against the local time."

https://docs.telerik.com/kendo-ui/controls/scheduling/scheduler/timezones

When I load the data back into the  scheduer , it shows the 1am date. Why doesn't the scheduler add my 7 hour offset and show  8am ? Do i need to add kendo.stringify ?

Thanks,Peter

peter
Top achievements
Rank 1
 answered on 21 Aug 2019
2 answers
1.1K+ views

Hello,

I noticed a bug with your Tooltip that I haven't been able to find a solution for in your forums.  When using your tooltip, when I'm scrolled up to the very top of the page and mouse over the button with the tooltip, it displays perfectly fine.  However, when I scroll further down the page and then mouse over the button with the tooltip, the tooltip's position gets pushed down.  It seems to remain static where it is, and doesn't update based on where the element is that it's targeting.  I've attached a couple screenshots to show what I mean by this, and the arrows in each screenshot show what element I'm hovering over to display the tooltip.  The tooltip just displays in the wrong position if I scroll a little bit down the page.  If anyone can help me with the solution to this, please let me know.  Here's my code for the tooltip below:

@(Html.Kendo().Tooltip()
 .For("#denyCredit")
 .Position(TooltipPosition.Bottom)
 .Content("Denied Credit - Follow Up with Vendor using Interrogation Report"))
Petar
Telerik team
 answered on 20 Aug 2019
3 answers
120 views
The data returned by the API is not displayed in the list, and there is no data displayed
Alex Hajigeorgieva
Telerik team
 answered on 19 Aug 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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?