Telerik Forums
UI for ASP.NET MVC Forum
1 answer
31 views

Is it possible to extend the Telerik MVC Grid toolbar to include custom commands? I'm looking to add my own functionality to the toolbar, and I'm wondering if there's a way to create a method within the toolbar command factory to generate buttons with specific functionality that I want to apply across all grids in my application.

For example, I have these three methods I have added using the toolbar template.


instead of using the template every time I would like to add custom command like save or excel.

Anton Mironov
Telerik team
 answered on 11 Mar 2024
1 answer
198 views
Using the UI for ASP.NET MVC 2023.2.606 build and trying to set custom icons for the native grid excel export toolbar item (ref snippet below) - unlike the same build # for MVC CORE the .IconClass "override" setting is not respected and defaults to rendering the pure kendo .svg icon for excel.  Compare the 2 image captures of the rendered html/classes for the same defined toolbar between the ASP.NET MVC and MVC CORE builds


                       .ToolBar(t => {
                            if (PermissionHelper.HasPermissionAny(Roles.RoleAdmin))
                            {
                                t.Create().Text("Add User Role");
                            }
                            t.Excel().Text("Export to Excel").IconClass("fa-solid fa-file-excel");
                        })
Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 26 Jun 2023
1 answer
76 views

I have an application with a Kendo MVC ToolBar including buttons with french text or including ampersands such as "R&D". 

This used to display correctly as "R&D" but since a recent update of the Telerik MVC controls, it displays encoded as "R&D".
If there is an apostrophe, a text like "En attente d'approbation" will show as "En attente d'approbation".

I can reproduce this problem in your demos, for example see:

Kendo UI demo
https://dojo.telerik.com/ErEXiBul

Telerik MVC demo
https://dojo.telerik.com/egulokat

Is there any way to get this to display as expected? I tried different things but it always show up with &amp text on the screen which is bad.

Thank you!

 

Martin
Telerik team
 answered on 28 Apr 2023
1 answer
78 views
Hi.  I inherited an MVC application that is using this version - 2013.2.6.11.340. I need to updgrade away from this, as it was discovered that there is a security issue w/anything 2020 and below.  Is ther a document that can assist me in this regards?
Anton Mironov
Telerik team
 answered on 25 Jan 2023
0 answers
65 views

Hello, I have a kendo grid in /employees/grid where there is an edit button on the line opening an edit popup

1. Would you like to put this button on another page /consultation/paycheck to open this edit popup?

2. or open this grid /employees/grid in a popup on another page?

thank you

Rafael
Top achievements
Rank 1
 asked on 02 Jul 2022
1 answer
344 views

Hi,

I have kendo mvc grid in my application and I am using toolbar to save the changes in the grid, Toolbar is coming on the top of the kendo grid. I want to add Toolbar at both top and bottom of the grid, please  suggest me to achieve  it.

Yanislav
Telerik team
 answered on 21 Mar 2022
1 answer
61 views

     I had a dropdownlist in a page populated like so

@(Html.Kendo().DropDownList()
    .Name("domain")
    .DataTextField("DomainName")
    .DataValueField("DomainName")
    .DataSource(dataSource =>
        dataSource.Read(read =>
            read.Action("GetDomainNames", "MinMax"))
    )
)

 

public JsonResult GetDomainNames()
{
    var dictDomains = new Dictionary<string, string>();
 
    using (var inoAutoEntities = new InoAutoEntities(InoAutoEntitiesHelper.GetEntityString(InoAutoEntitiesHelper.GetCredents())))
    {
        var localSettings = inoAutoEntities
            .Settings
            .Where(item => item.Machine == ".")
            .ToDictionary(item => item.Name);
 
        if (localSettings["UseAutomatedControlService"].Value=="True")
        {
            foreach (var domain in inoAutoEntities.CartSideDomains.GroupBy(item => item.Domain).Select(item => item.Key))
            {
                dictDomains.Add(domain, domain);
            }
 
        }
        else
        {
            var carts = inoAutoEntities.CartControls.Where(item => item.TypeControl == (int)ETypeControl.Owner).ToList();
            foreach (var cartControl in carts)
            {
                if (!dictDomains.ContainsKey(cartControl.Domain))
                {
                    dictDomains.Add(cartControl.Domain, cartControl.Domain);
                }
            }
 
        }
    }
 
    var returnList = dictDomains
        .Keys
        .OrderBy(item => item)
        .ToList();
 
    returnList.Insert(0,"All Domains");
    var result = returnList.Select(item => new DomainModel() {DomainName = item}).AsEnumerable();
    return Json(result,JsonRequestBehavior.AllowGet);
}

 

I wanted to move the dropdownlist to a toolbar but i see that the only way to do that is to use javascript to initialize

what is the syntax that would allow me to populate using a datasource that calls the controller action. I could not find information in the

documentation for toolbar or dropdownlist. any help would be appreciated

@(Html.Kendo().ToolBar()
     .Name("ToolBar")
     .Items(items =>
     {
         items.Add().Template("<div><label>Labels:</label><input id='labels' style='width: 150px;' /></div>").OverflowTemplate("<span></span>");
     }
     )
     )

 

<script type="text/javascript">
    $(document).ready(function () {
        $("#labels").kendoDropDownList({
            dataTextField: "DomainName",
            dataValueField: "DomainName"
        });
    });
 
</script>

 

 

 

Ivan Danchev
Telerik team
 answered on 08 Feb 2021
1 answer
31 views

     Hello All, I am actually usingl ocalization for displaying texts in Window title,

In the .resx file i have a text like  PopUpAjouter_Titre: Saisie d'une écriture .

In .cshtml file i am using this syntax to display the value

 @(Html.Kendo().ToolBar().Name("ToolBar").Resizable(false)
                                    .Items(items =>
                                    {
                                        items.Add().Type(CommandType.Button).Id("btnRefresh").SpriteCssClass("k-i-reload").ShowIcon(ShowIn.Both).HtmlAttributes(new { @title = Web.Resources.Views.TView.Action_Refresh, @class = "k-button-rond-ext" });
                                        items.Add().Type(CommandType.Separator).HtmlAttributes(new { @style = "border-color: rgba(0,0,0,0.08);" });
                                        items.Add().Type(CommandType.Button).Id("btnAjouter").SpriteCssClass("k-i-add").ShowIcon(ShowIn.Both).HtmlAttributes(new { @title = Web.Resources.Views.TView.Action_CreationEcritures, @class = "k-button-rond-ext",
                                            data_titre =  Web.Resources.Views.TView.PopUpAjouter_Titre)
                                        });

}))

when this page is rendered in the chrome browser the html tag is displayed like below

 

<a role="button" href="" tabindex="0" title="Création" class="k-button-rond-ext k-button k-button-icon" data-titre="Saisie d#39;une écriture" id="btnAjouter" data-uid="52af038a-512d-4456-bc78-1cd9cfe83fdd" data-overflow="auto" aria-disabled="false"><span class="k-sprite k-icon k-i-add"></span></a>

and the actual text is not displaye the singlequote or apostrophe is displayed as &#39;

But when i display the same value in a Paragraph like,<p>@Web.Resources.Views.TView.PopUpAjouter_Titre</p>

 

it is displayed like this in the chrome browser, <p>Saisie d'une écriture de trésorerie</p>

If anyone has encountered this issue, please help me.

 

Regards,

NAIDU Geetha

Petar
Telerik team
 answered on 07 Sep 2020
1 answer
84 views
Is there any way to add a template to a MenuButton? 
Eyup
Telerik team
 answered on 23 Jan 2019
1 answer
287 views

Hi,

If I change the text of a button it removes span and other classes as well.

This is my code but doesn't work.

@(Html.Kendo().Menu()

                            .Name("HeaderMenu")
                            .Items(items =>
                            {
                                items.Add().Text("Home").Action("Index", "Home").SpriteCssClasses("fa fa-home");
                                items.Add().Text("About").Action("About", "Home").SpriteCssClasses("fa fa-info");
                                items.Add().Text("Contact").Action("Contact", "Home").SpriteCssClasses("fa fa-mobile-phone");
                                items.Add().Text("User").HtmlAttributes(new { id = "userloggedin" }).SpriteCssClasses("fa fa-user").Items(children => {
                                    children.Add().Text("Sign out").SpriteCssClasses("fa fa-sign-out").HtmlAttributes(new { id = "signout" }).Enabled(false);
                                });
                            }))

 

<script type="text/javascript">
    function onButtonClick(e) {
            var html = $("#userloggedin").children(".k-link").html();
            console.log(html);
            $("#userloggedin").children(".k-link").text("It is me!");

            html = $("#userloggedin").children(".k-link").html();
            console.log(html);

    }

</script>

Dimitar
Telerik team
 answered on 12 Oct 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?