Telerik Forums
UI for ASP.NET Core Forum
2 answers
90 views

how to validate the required field

which i define it the class as Required 

        example 
        [Required]
        public string Title { get; set; }
        [Required]
        public string Description { get; set; }

when i create new Record in grid asp.net Core

then i press Save button directly catch the controller with out any validation 

there is event in the grid 

.Events(e => e.Error("error"))

<script>
    function error(e) {

        console.log(e);
        if (e.errors) {
            var message = "Errors: \n";
            $.each(e.errors, function (key, value) {
                if ('errors' in value) {
                    $.each(value.errors, function () {
                        message += this + "\n";
                    });
                }
            });
            alert(message);
        }
    };

</script>
any help please 

 

 

 

 

 

Alex Hajigeorgieva
Telerik team
 answered on 05 Nov 2019
1 answer
860 views

Hi,
is it possible to generate barcodes on the server side in .NET Core? I need generate a barcode image as base64 string.

Thanks,
MT

Alex Hajigeorgieva
Telerik team
 answered on 01 Nov 2019
4 answers
202 views

Hi,

I am trying to add an area of best fit to a standard scatter plot: I have one set of data points, and two equations for lines of best fit. The desired result is a scatter plot of the data points with a shaded area between the two lines of best fit.

I understand that it is currently not possible to mix categorical and XY charts (https://www.telerik.com/forums/using-area-and-scatter-chart-types-in-one-chart). I have tried drawing the desired area on the scatter chart as per https://docs.telerik.com/kendo-ui/controls/charts/how-to/appearance/draw-on-scatter-plots, however this results in the area being superimposed on the chart surface and prevents user interaction with the data points (tool-tips etc.) so is not an acceptable solution.

Is there any other way to achieve the desired result? Please see attached for a simplified example of what I'm trying to achieve.

David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 01 Nov 2019
1 answer
117 views

Hello,

I have a shared datasource that returns a model that has four lists

Model:

public class BillModel : DocumentBaseModel

{

         ...

        public List<HistoryModel> History { get; set; }
        public List<AmendmentModel> Amendments { get; set; }
        public List<OtherDocModel> OtherDocs { get; set; }
        public List<PreviousVersionModel> PreviousVersions { get; set; }

}

Shared Datasource:

             @(Html.Kendo().DataSource<BillModel>()
                       .Name("myDataSource")
                       .Custom(dataSource =>
                       {
                           dataSource
                           .Type("json")
                           .Transport(transport =>
                           {
                               transport.Read(read =>
                               {
                                   read.Action("GetBill", "Bills", new { billNo = "#=Id#" });
                               });
                           });
                       })
                 )

And one of my DDLs:

@(Html.Kendo().DropDownList()
                        .Name("amendments")
                        .DataTextField("Name")
                        .DataValueField("LFID")
                        .DataSource("myDataSource")
                        .HtmlAttributes(new { style = "width: 100%" })
                     .ToClientTemplate()
                 )

Plamen
Telerik team
 answered on 31 Oct 2019
1 answer
341 views

Hello,
I have a model with a few lists.  I am trying to use a shared datasource to populate a dropdownlist for each of these lists but I am having trouble with how to refer to a specific subobject within the object that is returned from the controller.  I’m sure that this has been done before… I’m just having trouble finding an example.

My model looks like this:
public class BillModel : DocumentBaseModel
    {
        …

        public List<HistoryModel> History { get; set; }
        public List<AmendmentModel> Amendments { get; set; }
        public List<OtherDocModel> OtherDocs { get; set; }
        public List<PreviousVersionModel> PreviousVersions { get; set; }
    }

My controller returns the BillModel
My view has a grid that accesses a ClientTemplate that has three ddls and my shared datasource.
@(Html.Kendo().DataSource<BillModel>()
.Name("myDataSource")
       .Custom(dataSource =>
       {
              dataSource
                     .Type("json")
                     .Transport(transport =>
                     {
                           transport.Read(read =>
                           {
                              read.Action("GetBill", "Bills", new { billNo = "#=Id#"});
                            });
                     });
       })
)
@(Html.Kendo().DropDownList()
.Name("amendments")
       .DataTextField("Name")
       .DataValueField("LFID")
       .DataSource("myDataSource")
       .HtmlAttributes(new { style = "width: 100%" })
  .ToClientTemplate()
)

@(Html.Kendo().DropDownList()
.Name("others")
       .DataTextField("Name")
       .DataValueField("LFID")
       .DataSource("myDataSource")
       .HtmlAttributes(new { style = "width: 100%" })
  .ToClientTemplate()
)

@(Html.Kendo().DropDownList()
.Name("previous")
       .DataTextField("Name")
       .DataValueField("LFID")
       .DataSource("myDataSource")
       .HtmlAttributes(new { style = "width: 100%" })
  .ToClientTemplate()
)

How do I get each ddl to use their list from the datasource?  I thought perhaps I could use dot notation and write .DataTextField(“Amendments.Name”).  It didn’t yell at me it just said undefined.  I’m sure it must be something simple I just can’t figure it out today.

Plamen
Telerik team
 answered on 31 Oct 2019
2 answers
111 views

My project is core but this is really just simple view.  I want to convert some simple html to pdf and "Save As" to the local machine.   I dumbed down my actual view fo the example but please help me understand why this works (pdf is generated and saved to downloads) on my local machine but not in production (tried in Chrome/Edge/IE).

Heres a dojo link;  http://dojo.telerik.com/@bdaun1@gmail.com/  (doesn't work here either... only when I run in dev on my machine)

 

Thanks!

BD

 

<!DOCTYPE html>
<html>
<head>
</head>
<body>
    <div class="box wide hidden-on-narrow">
        <div class="box-col">
            <button class="export-pdf k-button" onclick="getPDF()">ExportToPDF</button>
        </div>
    </div>
    <div class="page-container hidden-on-narrow">
        <div class="pdf-page">
            <div class="pdf-header">
                <span class="company-logo"></span>
            </div>
            <div class="pdf-body">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-8">
                            <p>Test Area1</p>
                        </div>
                        <div class="col-sm-12">
                            <hr />
                            <h3>Purpose Statement</h3>
                            <p>Test Area2</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
 
    <script>
        function getPDF() {
            kendo.drawing.drawDOM($('.pdf-page')).then(function (group) {
                kendo.drawing.pdf.saveAs(group, "OrgOverview.pdf");
            });
        }
    </script>
 
    <style>
        .pdf-page {
            position: relative;
            margin: 0 auto;
            padding: .4in .3in;
            color: #333;
            background-color: #fff;
            box-shadow: 0 5px 10px 0 rgba(0,0,0,.3);
            box-sizing: border-box;
            font-family: "DejaVu Sans", "Arial", sans-serif;
        }
 
        .pdf-header {
            padding-bottom: .2in;
            margin-bottom: .3in;
            border-bottom: 1px solid #e5e5e5;
        }
    </style>
</body>
</html>
Bill
Top achievements
Rank 1
 answered on 31 Oct 2019
1 answer
161 views
I've been looking through demos of document processing, and I'm only seeing format conversion in the demos for ASP.Net Core. When I view demos for document processing for ASP.Net MVC, I see mail merge and other functionality. Is mail merge and editing also supported in UI for ASP.Net Core?
Nencho
Telerik team
 answered on 30 Oct 2019
2 answers
922 views

Hello,

 

It's seem that ForeighKey always use GridForeignKey.cshtml…

I try to decorate the attribute UIHint with another cshtml (Shared/EditorTemplates) and it's not working.  My dropdown list in the grid always use GridForeignKey.cshtml.

 

Any idea?

Louis
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 26 Oct 2019
1 answer
273 views
Hello,
Out of the box, using the 'Telerik UI for ASP.NET Core' -> Create New Telerik Project (Grid and Menu) extension in Visual Studio 2019 + .NET Core 3.0 does not appear to work correctly. The project will get created and will build and run correctly, however when I try to add a new View or Controller I will get the attached error. I kept adding libraries that the error was complaining about until it worked, however I'm not sure this was the correct way to go about fixing this (see attached). 

Is there a reason the out of the box extension to create a project is not working?
I've submitted a bug regarding this as well. 

Thanks,
Dave
Dimitar
Telerik team
 answered on 25 Oct 2019
3 answers
292 views

Hello,
we are currently following this guide (https://docs.telerik.com/aspnet-core/getting-started/first-steps-cli)
to setup Telerik UI for ASP.NET Core 3.0.100 (not RC).
After we run "dotnet add package Telerik.UI.for.AspNet.Core" we see that the version "2016.3.914" is downloaded and installed, and NOT the version "2019.3.917" we see from here: https://www.telerik.com/account/product-download?product=UIASPCORE
Obviously with old this version "dotnet run" throws errors.

What are we missing?

We tried to downgrade to dotnet SDK 3.0.100-RC but nothing changes.
Forcing installing the specific version with "dotnet add package Telerik.UI.for.AspNet.Core -v 2019.3.917" returns error "Unable to find package Telerik.UI.for.AspNet.Core with version (>= 2019.3.917)"
Our platform is Linux and we downloaded dotnet sdk from here https://dotnet.microsoft.com/download/thank-you/dotnet-sdk-3.0.100-linux-x64-binaries
We have trial license of Progress® Telerik® UI for ASP.NET Core

 

Thanks for your support

 

my nuget.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="telerik.com" value="https://nuget.telerik.com/nuget" />
  </packageSources>
  <packageSourceCredentials>
      <telerik.com>
           <add key="Username" value="enrico.papi@re-lab.it" />
         <add key="ClearTextPassword" value="*********" />
      </telerik.com>
  </packageSourceCredentials>
</configuration>

 

my csproj after we add the package:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Telerik.UI.for.AspNet.Core" Version="2016.3.914" />
  </ItemGroup>
</Project>

Dimitar
Telerik team
 answered on 25 Oct 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?