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

I wanted to use Telerik Asp.Net Core plugins in my project. When I am trying to copy the menu component of Telerik UI, it throws error on Basecontroller class and [Demo] annotations. Please let me know, what is this error about and how to fix it.

Veselin Tsvetanov
Telerik team
 answered on 26 Oct 2018
1 answer
374 views

Hi

I Have a grid like this :

01.@(Html.Kendo().Grid<TMain>()
02.                 .Name("gridEQ")
03.                 .Columns(c =>
04.                 {
05.                     c.Group(g =>
06.                         g.Title("History")
07.                             .Columns(i =>
08.                             {
09.                                 i.Bound(x => x.History.HairLoss).ClientTemplate("#= History.HairLoss ? 'Yes' : '' #");
10.                                 i.Bound(x => x.History.WT_Gain).ClientTemplate("#= History.WT_Gain ? 'Yes' : '' #");
11.                                 i.Bound(x => x.History.Wt_loss).ClientTemplate("#= History.Wt_loss ? 'Yes' : '' #");
12.                             })
13.                         );
14.                     c.Group(g =>
15.                         g.Title("PmhDh")
16.                             .Columns(i =>
17.                             {
18.                                 i.Bound(x => x.PmhDh.Levothyroxine);
19.                             })
20.                         );
21.                 })
22.                 .Sortable()
23.                 .Pageable()
24.                 .Scrollable()
25.                 .DataSource(d => d
26.                     .Ajax()
27.                     .PageSize(20)
28.                     
29.                     .ServerOperation(true)
30.                     .Read(r => r.Action("SendData", "MyAction"))
31. 
32.                 ))

I want hide columns if all cell of column was empty value and if all columns of a group was hide the column of group also hide too .

for example if Levothyroxine column data was empty string the Levothyroxine column hide and PmhDh hide too.

my problem is i have 230 columns that i must show in this grid and i want hide empty columns

Konstantin Dikov
Telerik team
 answered on 25 Oct 2018
1 answer
217 views

Hi,

I am trying to have a list of Offices for an Organisation edited from a tabstrip, i can load the data and perform modifications easily but my problem arises when i want to add a new office when i click on a button. i use the API to add a tab but i do not know if it is possible for me to specify that the content should be loaded from an action. 

Veselin Tsvetanov
Telerik team
 answered on 24 Oct 2018
1 answer
336 views

Hello Team;

Do we have a Kanban Widget in Kendo UI for ASP.Net Core 2.1?
I saw an application that had used Kendo UI jQuery widget and they told me their Kenban widget was from Telerik. However, when I look at t he list of ASP.Net core widgets I can't find any with that name.

Could you please shed some light where to find it?
Thanks!

Vessy
Telerik team
 answered on 24 Oct 2018
4 answers
159 views

Hi

I have a Class like this : 

public class History
{
public bool Wt_loss { get; set; }
 public bool WT_Gain { get; set; }
 public bool HairLoss { get; set; }
}
 public class PmhDh{
public string Levothyroxine { get; set; }
 }
 public class Datum{
public History History { get; set; }
public PmhDh PmhDh { get; set; }
 }

and i fill the main class with some data

i want to show this class in kendo grid mvc wit main header and sub header but i my code not work correctly

this is my grid code :

@(Html.Kendo().Grid<dynamic>()
                 .Name("gridEQ")
                 .Columns(columns => columns.AutoGenerate(true))
                 .Sortable()
                 .Pageable()
                 .Scrollable()
                 .DataSource(d => d
                     .Ajax()
                     .PageSize(20)
                     .ServerOperation(true)
                     .Read(r => r.Action("SendData", "Thyroid"))
                     
                 ))

and attach the result on this post

please help me

thanks

Viktor Tachev
Telerik team
 answered on 23 Oct 2018
1 answer
158 views

@(Html.Kendo().Grid<BitteleERP.MVC.Models.Corporation>()
                .Name("grid")
            .Columns(columns =>
            {
                columns.Command(command => command.Custom("Edit").Click("edit")).Width(40);
                columns.Command(command => command.Custom("Delete").Click("deleted")).Width(40);
                columns.Bound(c => c.Name).Width(140);
                columns.Bound(c => c.Location).Width(190);
                columns.Bound(c => c.DefaultCurrency).Width(100);
            })
            .ToolBar(toolbar =>
            {
                toolbar.ClientTemplateId("GridToolbarTemplate");
            })
            .HtmlAttributes(new { style = "height: 380px;" })
            .Sortable()
            .Scrollable(scrollable => scrollable.Virtual(true))
            .HtmlAttributes(new { style = "height:84vh;" })
            .DataSource(dataSource => dataSource
                .Ajax()
                .Read(read => read.Action("Read", "Corporation"))
            )
)

 

<script id="GridToolbarTemplate" type="text/x-kendo-template">

    <div class="refreshBtnContainer">
        <a href="/Corporation/New" data-ajax="true" data_ajax_method="GET"  data_ajax_mode="replace" data-ajax-update="#ajax-content" class="k-pager-refresh k-link k-button " style="float:left" title="Add New"><span>Add New</span></a>
    </div>
</script>

--

data-ajax-update="#ajax-content" with # is not working with kendo

---

ncaught Error: Invalid template:'
    <div class="refreshBtnContainer">
        <a href="/Corporation/New" data-ajax="true" data_ajax_method="GET"  data_ajax_mode="replace" data-ajax-update="#ajax-content" class="k-pager-refresh k-link k-button " style="float:left" title="Add New"><span>Add New</span></a>
    </div>
' Generated code:'var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;with(data){$kendoOutput='\n    <div class="refreshBtnContainer">\n        <a href="/Corporation/New" data-ajax="true" data_ajax_method="GET"  data_ajax_mode="replace" data-ajax-update="';ajax-content" class="k-pager-refresh k-link k-button " style="float:left" title="Add New"><span>Add New</span></a>
    </div>
;$kendoOutput+=;}return $kendoOutput;'
    at Object.compile (kendo.all.min.js:25)
    at Object.d [as template] (jquery.min.js:2)
    at HTMLDocument.<anonymous> (Corporation:252)
    at i (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at Function.ready (jquery.min.js:2)
    at HTMLDocument.K (jquery.min.js:2)

 

 

 

Alex Hajigeorgieva
Telerik team
 answered on 22 Oct 2018
1 answer
40 views

hello.

when i update window with 

$(window).resize(function(){
    $("#chart").data("kendoChart").refresh();
});

my is fall and need reload window

Tsvetina
Telerik team
 answered on 19 Oct 2018
6 answers
1.1K+ views

     Hello,

 

I am trying to put an upload in a grid's editor so i can add a profile picture to my users. However, when the save action is called i always receive a null object. I am using an EditorTemplate to put the upload control in the grid's edit mode. 

 

I suspect that the reason it does not work has something to do with the Editortemplate since if i copy my upload control in my main view, it sends the files to the controller properly.

 

here are the relevant code snippets:

 

Controller  
[HttpPost]
        public ActionResult Save(IFormFile files)
        {
            //Do save
            return Content("");
        }

Editortemplate

@model string

@(Html.Kendo().Upload()
        .Name("files")
        .Multiple(false)
        .Async(a => a
            .Save("Save", "File")
            .AutoUpload(true)
        )
)

 

The grid Column 

            columns.Bound(c => c.ProfilePicture).Title("Photo").EditorTemplateName("FileUpload").ClientTemplate("<img src='" + Url.Action("GetImage", "File") + "?imageID=#= ProfilePicture.ID #' alt='Profil' height='172' width='147'>").Width(160);

 

 

 

Veselin Tsvetanov
Telerik team
 answered on 19 Oct 2018
2 answers
246 views

Hi, I think this is a bug.  

This menu item will not work:

<menu-item text="Search1" asp-action="search" asp-controller="Client" link-html-attributes='new { data_attr = "custom value" }'></menu-item>

 

This menu item will work:

<menu-item text="Search" asp-action="_search" asp-controller="Client" link-html-attributes='new { data_attr = "custom value" }'></menu-item>

 

The only difference is the underscore.  The underscore can be anywhere in the action name, but if it's not there, Telerik won't build the link with the action.  

Are my actions required to have underscores? 

 

Veselin Tsvetanov
Telerik team
 answered on 18 Oct 2018
4 answers
616 views

When using DateInputFor on a required nullable datetime it allows submit when date is blank. It should throw a field required error like DatePicketFor. Same error if you use DatePickerFor(...).DateInput().

 

using System;
using System.ComponentModel.DataAnnotations;
namespace WebApplication9.Models {
    public class TestViewModel {
        [Required]
        [DataType(DataType.Date)]
        public DateTime? TheDate { get;set;}
        [Required]
        [DataType(DataType.Date)]
        public DateTime? TheDate2 { get; set; }
    }
}

 

@model TestViewModel
<form asp-action="Index" method="post">
    <script type="text/javascript">
        $.validator.setDefaults({
            ignore: ""
        });
    </script>
    <p>
        @(Html.Kendo().DatePickerFor(m => m.TheDate))
        <span asp-validation-for="TheDate" class="text-danger"></span>
    </p>
    <p>
        @(Html.Kendo().DateInputFor(m => m.TheDate2))
        <span asp-validation-for="TheDate2" class="text-danger"></span>
    </p>
    <input type="submit" value="Go" />
</form>

 

 

Konstantin Dikov
Telerik team
 answered on 17 Oct 2018
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?