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

Hi Telerik Team,

I can't see from my mobile browser(telephone) my custom commands Attachment, Distribution, Structure. Desktop browser show everything ok.

telerik version: Telerik.UI.for.AspNet.Core 2019.2.619.

Tell me please, why custom command columns is not visible.

 

Code sample:

 

@(Html.Kendo().Grid<WorkFlow.Core.Models.Dto.DocumentTable>()
                                                                                                                        .Name("Grid")
                                                                                                                        .Columns(columns =>
                                                                                                                        {
                                                                                                                            columns.Bound(e => e.Id).Visible(false);
                                                                                                                            columns.Bound(e => e.Number).Title("Номер документа").HtmlAttributes(new { style = "text-align: center;" }).Width(120);
                                                                                                                            columns.Bound(e => e.InboxNumber).Title("Номер вх.документа").Width(120);
                                                                                                                            columns.Bound(e => e.DateReg).Format("{0: dd.MM.yyyy}").Title("Дата регистрации").Width(120);
                                                                                                                            columns.Bound(e => e.OrgName).Title("Откуда").Width(150);
                                                                                                                            columns.Bound(e => e.About).Title("Краткое содержание").Width(200);
                                                                                                                            columns.Bound(e => e.Mail).Title("Факс/Электронный адрес").Width(100);
                                                                                                                            columns.Bound(e => e.DocOwner).Title("От кого").Width(100);
                                                                                                                            columns.Bound(e => e.Address).Title("Адрес").Width(200);
                                                                                                                            columns.Bound(e => e.DepartmentName).Title("Исполнитель").Width(200);
                                                                                                                            columns.Bound(e => e.UserName).Title("ФИО(ОУЧРиДО)").Width(200);
                                                                                                                            columns.Command(command =>
                                                                                                                            {
                                                                                                                                command.Custom("Attachment").Click("openAttachment").Text(" ").IconClass("fa fa-mail-bulk");
                                                                                                                                if (User.IsInRole("Admin"))
                                                                                                                                {
                                                                                                                                    command.Custom("Distribution").Click("openDialog").Text(" ").IconClass("fa fa-mail-bulk");
                                                                                                                                }
                                                                                                                                command.Custom("Structure").Click("openDialogDistribute").Text(" ").IconClass("fa fa-edit");
                                                                                                                            }
                                                                                                                                );
                                                                                                                        })
                                                                                                               
                                                                                                                 .ToolBar(toolbar =>
                                                                                                                 {

                                                                                                                     toolbar.Excel().Text("Экспорт в Excel").HtmlAttributes(new { style = "height:70px;" }).IconClass("fa fa-mail-bulk");
                                                                                                                     if (User.IsInRole("Admin"))
                                                                                                                     {
                                                                                                                         toolbar.Custom()
                                                                                                                        .HtmlAttributes(new { onclick = "onClickCreateOutbox();return false;" })
                                                                                                                        .Name("CreateOutBoxButton").Text("  Создать исходящий документ").IconClass("fa fa-mail-bulk");
                                                                                                                         toolbar.Custom()
                                                                                                                         .HtmlAttributes(new { onclick = "onClickCreateButton();return false;" })
                                                                                                                         .Name("CreateButton").Text("  Создать входящий документ").IconClass("fa fa-mail-bulk");
                                                                                                                     }


                                                                                                                 })

                                                                                                                 .Excel(excel => excel
                                                                                                                                    .AllPages(true))

                                                                                                           .Mobile()
                                                                                                            .Sortable()
                                                                                                            .Pageable()
                                                                                                            .Resizable(resize => resize.Columns(true))
                                                                                                            .Filterable()
                                                                                                            .ColumnMenu()
                                                                                                            .Scrollable()
                                                                                                            .HtmlAttributes(new { style = "height:450px;" })

                                                                                                            .DataSource(datasource => datasource
                                                                                                           .Ajax()

                                                                                                           .PageSize(50)
                                                                                                           .Read(read => read.Action("GetDocuments", "Document", new { year = Model.year, typeDoc = Model.docType }))
                                                                                                           )
                                                                                                           .Resizable(resize => resize.Columns(true))
)
------------

<script type="text/javascript">

    $(document).ready(function () {
        var isMobile = Boolean(kendo.support.mobileOS);

        if (isMobile) {
            $("#Grid").data("kendoGrid").resize();
            alert('i m here');
        }
    });

</script>

Georgi Denchev
Telerik team
 answered on 29 Sep 2020
3 answers
524 views

Hi There ...

How to use tag helper on Grid with Local datasource

@model PromiseOnline.Models.ViewModels.PerintahKerjaHarianViewModel
 
@using PromiseOnline.Models.ViewModels
 
@{
    IList<PkhLphDetailFleetViewModel> PkhLphDetailFleet1ViewModels = Model.PkhLphDetailFleet1ViewModels;
    IList<PkhLphDetailFleetViewModel> PkhLphDetailFleet2ViewModels = Model.PkhLphDetailFleet2ViewModels;
}
 
@(Html.Kendo().Grid(PkhLphDetailFleet1ViewModels)
    .Name("gridPkhDetailFleet1Preview")
    .DataSource(dataSource => dataSource
        .Ajax()
        .ServerOperation(false)
    )
.
.
.
)
Preslav
Telerik team
 answered on 29 Sep 2020
1 answer
193 views

I have a kendo grid with Kendo context menu and it works fine when grid is placed directly on page.

When i place this Grid into a Kendo Tile layout, Context menu stops working.  Any suggestions to fix this issue?

Thanks

Tsvetomir
Telerik team
 answered on 29 Sep 2020
1 answer
115 views

How to stop passing parameter through query string ?

CSHTML:

@(Html.Kendo().Chart<UserWidgetFilterParameter>

.Read(read => read.Action(Model.actionMethod, Model.actionController, _recordValidationParameter).Type(HttpVerbs.Post))

Controller:

[HttpPost]

public JsonResult AccountRecordWidgetData(UserWidgetFilterParameter objwidgetParament1)

Parameters passing as below:

http://localhost:52670/Home/AccountRecordWidgetData?Jurisdiction=All&Regime=8&Filer=All&FilerGroup=All&WidgetId=1&UserWidgetID=211&F_Year=2020

Tsvetomir
Telerik team
 answered on 28 Sep 2020
1 answer
329 views
I've previously used VS2012 and struggling to learn VS2019 and ASP.NET Core. I've perhaps made the mistake of also downloading a trial version of the Telerik Core tools.

So I am trying to run through a very very simple tutorial and got to the part about Adding Entity Framework Core and then creating a data context. My system isn't recognising EntityFrameworkCore in the line using Microsoft.EntityFrameworkCore; of the context class. I've just spent a frustrating couple of hours hopelessly trying to find out where the problem is. I ended up going to the cli and trying to execute "dotnet add package Microsoft.EntityFrameworkCore --version 3.1.8" and I get 

info :   GET https://nuget.telerik.com/nuget/FindPackagesById()?id='Microsoft.EntityFrameworkCore'&semVerLevel=2.0.0
info :   OK https://nuget.telerik.com/nuget/FindPackagesById()?id='Microsoft.EntityFrameworkCore'&semVerLevel=2.0.0 599ms
error: Unable to find package Microsoft.EntityFrameworkCore. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget.telerik.com

So somewhere Telerik have hijacked the nuget and it is only referencing telerik.com and not microsoft. NOT happy.

 How do I get EntityFrameworkCore in my project 
Georgi Denchev
Telerik team
 answered on 28 Sep 2020
1 answer
394 views

 

I want to rotate the header text to 90 degree.

<style>
    .rotate-text {
        float: left;
        line-height: 0.7;
        -ms-transform: rotate(-90deg);
        -webkit-transform: rotate(-90deg);
        transform: rotate(-90deg);
        margin: 0;
        padding: 0;
    }
</style>
columns.Bound(c => c.Number).ClientHeaderTemplate("<div class='' >#=???#</div>");

 

How can i access the original header text inside of the template ?

 

Georgi Denchev
Telerik team
 answered on 23 Sep 2020
1 answer
103 views

I tried to update VS to the latest version and encountered a looping error in the Telerik Xamarin extensions.

After killing VS, I was able to update but the UI would then hang as soon as I tried to right-click on the project tree view (if I waited long enough - 45-60 seconds - it would sometimes "come back to life" but would still be unworkable).

 

 

Disabling the extensions did not fix the issue. I had to repair VS and reboot.

Nikola
Telerik team
 answered on 23 Sep 2020
1 answer
162 views

Hi,

I’m trying to load the data from an external source and, depending of that data, I would like to automatically set the right page in the Wizard.

How can I programmatically select that page?

Thank you

Plamen
Telerik team
 answered on 22 Sep 2020
1 answer
250 views

Hi,

What is the method for defining custom validation in a Form?  For example, in the Kendo UI for jQuery Form validation demo (https://demos.telerik.com/kendo-ui/form/validation) there is custom validation performed on the RetireDate to ensure that it's after the HireDate. However, the ASP.NET Core validation demo (https://demos.telerik.com/aspnet-core/form/validation)  contains no such validation.  Would it be possible to provide an example on how to perform this validation using ASP.NET Core?

Thanks,
Scott

Ivan Danchev
Telerik team
 answered on 21 Sep 2020
1 answer
539 views

Hello, 

I am currently in the process of localize a webapp. As I understood we're able to create custom localization files (either as a .js file or a .resx file) and use them to replace different labels from telerik components  (e.g 'Drag a column header and drop it here to group by that column' for grid grouping). The localization also includes the formatting of dates and currencies (basically the '.kendo.culture' -js for dates and formatting and the '.kendo.messages' for labels). 

My first question:

Is there a differene between creating a custom .js localization file or a custom .resx file(best practise, usability etc)? Most demos/example just using .js files for the localization and a few tutorials recommend to modifiy the .resx file, so I'm a bit confused. 

Second question:

Is there any way to use a localization file for 'hard strings' inside a html? Basically my ViewModel includes some properties which are displayed directly in a .cshtml file with a key before the property itself. 

For example :

<div>Firstname: @Model.Firstname</div>

 

My goal is to create multiple localization files that includes the key e.g "Firstname" and display it based on the current culture. 

Something like this

<div> @GetLocalizationStringWithWhatever("firstname") : @Model.Firstname </div>
// Result :
// If culture 'German' = <div>Vorname : Joe </div>
// if culture 'France' = <div>Prénom : Joe </div>
// if culture 'Italien' = <div>Nome di battesimo : joe </div>

 

There are probably multiple ways to achieve my goal (e.g safe the keys in a json and read it based on the current culture etc) but im curious if theres anyway to use the telerik (custom) localization files because I need them anyway and I'll be able to use one way to localize my entire webapp. I've tried to find something like that in demos/examples but it seems like theres no example yet. Is it possible?

 

Third question :

This question is very similar to my second question but basically my ViewModel got a few Date properties which are displayed directly in my .cshtml file. Currently I'm displaying them like this:

@Model.RandomDateVariable.Value.ToString("dd.MM.yyyy HH:mm");

The problem is the Dateformat won't change if the culture changes. The grid for example changes the dateformat if the culture changes and I want to achieve something similar directly inside a cshtml file. Again it seems like theres no demo/example/tutorial on how to achieve something like that. Is it possible?

 

Thanks in advance!

Greetings!

Aleksandar
Telerik team
 answered on 21 Sep 2020
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?