Telerik Forums
UI for ASP.NET Core Forum
3 answers
219 views

We are trying to export all pages of a grid to a pdf, but only the displayed page is exported to the pdf. The problem seems to be linked to using PaperSize, since it works when we remove it, but then we see the pager on each page. Here is the code we are using for the export :
    .Pdf(pdf => pdf
        .AllPages()
        .AvoidLinks()
        .PaperSize("A4")
        .Margin("2cm", "1cm", "1cm", "1cm")
        .RepeatHeaders()
        .TemplateId("page-template")
        .FileName("store.pdf")
        .Scale(0.8)
        .ForceProxy(true)
        .ProxyTarget("_blank")
        .ProxyURL(Url.Action("ExportToPdf", "Reports"))

Stefan
Telerik team
 answered on 11 May 2017
1 answer
317 views
Hi,

The company I am working for needs to move from an OpenSource grid to one with Commercial Backing and better Filtering/Grouping.

Telerik UI has been chosen on the short list and while it provides everything we need, I am unable to find any options to modify the .

Is it easy from the HtmlHelper to have a Drop-down on the Pager to select a  pagesize and optionally show all the pages? We would be using the grid with InLine editing mode enabled. NOTE: I understand all pages can be calculated but would be a better UX if the option said All.

For Example Page Sizes: 10, 25, 50, ALL

Thanks in advance.
Pavlina
Telerik team
 answered on 10 May 2017
2 answers
1.1K+ views

I'm using the UI for MVC Core (Core 1.1). I need to allow users to build their own input forms (unlimited number of inputs and forms). I am storing the configuration of the form (e.g. settings for combobox, dateinput, textbox, etc.) in a database. I want to create the necessary mvc wrappers and save them to a file (or db)...i.e. cache the form. That way when the form is requested, I can just load the cached form. Here is an example of what I would store in a file or database.

@(Html.Kendo().NumericTextBox<decimal>().Name("currency").Format("c"))
@(Html.Kendo().NumericTextBox<decimal>().Name("currency2").Format("c").Value(50))

 

Is it possible to then load this information from database or file and have it parsed on a page (i.e. generate the kendo controls)?Or do the wrappers have to be added to the page at design time? If possible, how would I load the file?

Or do I need to create the Kendo html elements instead like below? Or is there another option?

<input id="currency" type="number" />
<input id="currency2" type="number" value="50" />
 
<script>
  $(document).ready(function() {
    $("#currency").kendoNumericTextBox({format: "c"});
    $("#currency2").kendoNumericTextBox({format: "c"});
  });
</script>

 

Ianko
Telerik team
 answered on 10 May 2017
1 answer
6.2K+ views

Hi, I set up a project which I build and run fine on Windows. When I bring it over to ubuntu and try to build, I have these errors

 

error CS1061: 'IServiceCollection' does not contain a definition for 'AddKendo' and no extension method 'AddKendo' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?) 

error CS1061: 'IApplicationBuilder' does not contain a definition for 'UseKendo' and no extension method 'UseKendo' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?) 

 

csproj file

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
    <PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" />
    <PackageReference Include="Telerik.UI.for.AspNet.Core" Version="2017.2.504" />
  </ItemGroup>
</Project>

 

Startup.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
 
namespace TelerikAspNetCore
{
    public class Startup
    {
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                .SetBasePath(env.ContentRootPath)
                .AddEnvironmentVariables();
            Configuration = builder.Build();
        }
 
        public IConfigurationRoot Configuration { get; }
 
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            services.AddMvc();
            services.AddKendo();
        }
 
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            app.UseDeveloperExceptionPage();
 
            app.UseStaticFiles();
            app.UseKendo(env);
 
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }
    }
}
Ianko
Telerik team
 answered on 10 May 2017
1 answer
425 views

Hi

How do insert a DropDownList within a PanelBar?
I have the following code but it does not work:

 

I'm using version 2017.1.118
  
Thanks!

@(Html.Kendo().PanelBar()
      .Name("panelForm")
      .ExpandMode(PanelBarExpandMode.Single)
      .Items(panelbar =>
      {
          panelbar.Add().Text("My Teammates")
                  .Expanded(true)
                  .Content(@<text>
                            @(Html.Kendo().DropDownList()
                                  .Name("size")
                                  .BindTo(new List<string>()
                                  {
                                    "S - 6 3/4\"",
                                    "M - 7 1/4\"",
                                    "L - 7 1/8\"",
                                    "XL - 7 5/8\""
                                  })
                                  .HtmlAttributes(new { style = "width: 100%" })
                                  .Deferred()
                                                )
                           </text>);
      })
      .Deferred()
)
Dimitar
Telerik team
 answered on 10 May 2017
3 answers
343 views

I am trying to implement an inline editor inside each item of a TreeView widget.

TreeView initialization:

01.@(Html.Kendo()
02.    .TreeView()
03.    .Name("treeview")
04.    .TemplateId("treeview-template")
05.    .Items(it1 =>
06.    {
07.        it1.Add().Id("1").Text("Test1")
08.            .Items(it2 =>
09.            {
10.                it2.Add().Id("2").Text("Test2");
11.            });
12.    })
13.)

TreeView template:

1.<script id="treeview-template" type="text/kendo-ui-template">
2.#var id = 'editor_' + item.id;#
3.@(Html.Kendo()
4.    .Editor()
5.    .Name("#=id#")
6.    .Value("#=item.text#")
7.    .ToClientTemplate())
8.</script>

 

But when I click on an item, the editor is not opening. The click just selects the TreeView item.

When I add a click listener in javascript to the editor instance and call "...date('kendoEditor').toolbar.show()",

I get the toolbar but no focus, and when I set the focus manually its always at the beginning of the text.

It seems that some events on the TreeView are preventing the inline edit event (i.e. the 'select' event of the TreeView?).

Another example: http://demos.telerik.com/aspnet-core/treeview/index add a "contenteditable=true" to any item and try to click it. The cursor appears for a second and then the item loses focus.

Do you think there is any possibility to get this working?

Jan
Top achievements
Rank 1
 answered on 09 May 2017
4 answers
313 views

Hello,

I tried to create a TreeView with a custom ClientTemplate to instanciate an editor for each

Example (I just broke it down to the required settings):

01.@(Html.Kendo().TreeView()
02.    .Name("treeview")
03.    .TemplateId("treeview-template")
04.    .Items(it1 =>
05.    {
06.        it1.Add().Id("1").Text("Test1")
07.            .Items(it2 =>
08.            {
09.                it2.Add().Id("2").Text("Test2");
10.            });
11.    })
12.)

 

1.<script id="treeview-template" type="text/kendo-ui-template">
2.    @(Html.Kendo().Editor()
3.        .Name("editor_#=item.id#")
4.        .Value("#=item.text# #=item.id#")
5.        .ToClientTemplate())
6.</script>

 

In the browser console I get the script error "Error: Invalid template: ...". As soon as I remove the #=item.id# in the .Name-function, it is working, but I have a name conflict with multiple instances (therefore I need the id inside the name). The same error occurs if I try .Name("editor_#=item.text#"). The value output of text and id is correct. Is this a bug in the editor widget or what am I doing wrong?

Dimitar
Telerik team
 answered on 04 May 2017
2 answers
663 views

Hello, 

I 'm have a view based on a ViewModel. This View Model has one Complex Property which is a collection.

public class ParentViewModel
    {
        public int Id { get; set; }

    public int Description  { get; set; }

        public List<SecurityListViewModel> secList { get; set; }
    }

Konstantin Dikov
Telerik team
 answered on 03 May 2017
1 answer
225 views

Hi Guys,

i Have Problem with binding:

 

If I use this :

.BindTo((System.Collections.IEnumerable)ViewData["Analyten"])

it's work but if I us this:

.BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])

 

it does not work

Have you  any idea ?

 

Thank you

 

 

@model Delphi.ViewModels.VMAnalytCRUD
 
    @(
 Html.Kendo().DropDownListFor(m => m.AnalytId)
   .BindTo((System.Collections.IEnumerable)ViewData["Analyten"])
   // .BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])
    .DataTextField("AnalytName")
    .DataTextField("AnalytNummer")
    .DataValueField("AnalytId")
    .Template("#= AnalytNummer # - #= AnalytName #")
    .ValueTemplate("#= AnalytNummer # - #= AnalytName #")
    .Filter(FilterType.Contains)
    .AutoBind(false)
    )
Boyan Dimitrov
Telerik team
 answered on 27 Apr 2017
1 answer
119 views

Hello,

first of all the "UI for ASP.NET Core Forum" has no category for "Dialog", so I post my request here.

I tried to implement the dialog with help of the TagHelper as described here http://demos.telerik.com/aspnet-core/dialog/tag-helper. But I found no way to implement some action buttons, as I can do with the C# Razor Helper. I also found this page http://docs.telerik.com/aspnet-core/helpers/dialog but under the tab "tagHelper" there is some strange tag-format with ":" which is not working.

Nikolay
Telerik team
 answered on 24 Apr 2017
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?