Telerik Forums
UI for ASP.NET MVC Forum
2 answers
215 views

With the release version of Core, I am now getting this error on Kendo Grid Read Action.

TypeLoadException: Could not load type 'Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions' from assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'

Here is the top part of the Stack Trace:

System.TypeLoadException: Could not load type 'Microsoft.Extensions.DependencyInjection.ServiceProviderExtensions' from assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
   at Kendo.Mvc.UrlGenerator.GetUrlHelper(ActionContext context)
   at Kendo.Mvc.UrlGenerator.Generate(ActionContext context, INavigatable navigationItem, RouteValueDictionary routeValues)
   at Kendo.Mvc.UrlGenerator.Generate(ActionContext context, INavigatable navigationItem)
   at Kendo.Mvc.UI.NavigatableExtensions.GenerateUrl(INavigatable navigatable, ViewContext viewContext, IUrlGenerator urlGenerator)
   at Kendo.Mvc.UI.Fluent.CrudOperationBuilderBase`1.SetUrl()
   at Kendo.Mvc.UI.Fluent.CrudOperationBuilderBase`1.Action(String actionName, String controllerName, Object routeValues)
   at Kendo.Mvc.UI.Fluent.CrudOperationBuilderBase`1.Action(String actionName, String controllerName)
   at AspNetCore._Views_Organisations_Details_cshtml.<>c.<ExecuteAsync>b__27_3(CrudOperationBuilder read) in /Views/Organisations/Details.cshtml:line 61

Marin Bratanov
Telerik team
 answered on 30 Jun 2016
1 answer
198 views

I use UI for ASP.NET MVC Q2 2016.

I cannot figure out how to localize the edit and destroy button in the column command of my grid.

My app is using asp.net core rc2

I have include the localization feature using resource.

The default culture is en-US as stated in startup.cs

    options.DefaultRequestCulture = new RequestCulture(culture: "en-US", uiCulture: "en-US");

In the Model I manage the localization with resources file "...en-US.resx"

    public class TA_ACCESSORY_ACC
    {

    [MaxLength(ApplicationDbOperation.DM_SHORTTEXT, ErrorMessage = "idsMaxError")]
    [Display(ResourceType = typeof(ApplicationResources),Name = "idsName")]
    public string NAME_ACC { get; set; }

   }

The column of the grid are well translated from french to English but the button command still remain in french.

Any help will be very appreciated.

 

Michel
Top achievements
Rank 1
 answered on 29 Jun 2016
2 answers
427 views

Is there an easy way to use the toolbar.Create() and toolbar.Save() builders in the toolbar template.

I want to add a dropdown for filtering while maintaining the default buttons.

I see no way to get toolbar.Create() to send me it's rendered text to add to the template??

Basically I want to duplicate something like this demo http://demos.telerik.com/kendo-ui/grid/toolbar-template but still have the standard add/save buttons in the toolbar as well.

 

 

 

Bob
Top achievements
Rank 1
 answered on 29 Jun 2016
3 answers
427 views

Hi,

I am new to Kendo and are trying to add a custom command to a grid.
I have been going over examples and this forum and found multiple examples that has the following:

columns.Command(command =>
{
     command.Custom("Details").Text("Show Details").Action("Details", "Billing");
});

 

When I try to use this, I get the following error:
'GridCustomActionCommandBuilder<myModel>' does not contain a definition for 'Action' and the best extension method overload 'UrlHelperExtensions.Action(IUrlHelper, string, object)' requires a receiver of type 'IUrlHelper'

 

I then tried this example from http://docs.telerik.com/kendo-ui/aspnet-mvc/helpers/grid/configuration:

columns.Template(@<text>@Html.ActionLink("Edit", "Home", new { id = item.ProductID })</text>);

But get this error:
Cannot convert lambda expression to type 'string' because it is not a delegate type

 

Please can someone please help me with this.

I am using existing samples but don't know what is wrong.

Thank you

Eyup
Telerik team
 answered on 29 Jun 2016
7 answers
1.5K+ views

I have a ToolBar with a Click handler defined, and some items, kind of like below

Html.Inteum().ToolBar().Name(tab.Name).Events(events => events.Click("TabItem_Click"))
.Items(items =>
{
    items.Add().Type(CommandType.SplitButton).Text("blahblah").Url("someURL");
}

function TabItem_Click(e) {
    e.preventDefault();
    LoadPageAsync(e.target.data().button.options.url);
    return false;
}

What I'm hoping to do is to prevent navigation to a new page when you click on a button, and instead load that target up asynchrnously. But the navigation is never prevented. How do I keep the navigation from happening?

Grahame
Top achievements
Rank 2
 answered on 28 Jun 2016
2 answers
255 views

I have a grid that I initalize via the .NET wrapper. I can do the following:

columns.Bound(r => r.SampleColumn).ClientGroupHeaderTemplate("#= myFunction2(data, 50) #")

But I can't do this:

columns.Bound(r => r.SampleColumn).Filterable(f => f.Cell(c => c.Template("#= myFunction1(data, 100) #")))

I get a JS error. Any idea why? I would like to pass in an additional variable on the view.

Fillip
Top achievements
Rank 1
 answered on 28 Jun 2016
1 answer
94 views

In using the grid, with filterable (.Filterable(ftb => ftb.Mode(GridFilterMode.Row))), the icons and/or styles seem to be missing.  I am using the CDN source for my includes:

<link href="~/Content/Site.css" rel="stylesheet" type="text/css" />
  <link href="http://uilibrary.Vensure.com/Styles/reset.css" rel="stylesheet" type="text/css">
 
  <script src="~/Scripts/modernizr-2.6.2.js"></script>
  <script src="~/Scripts/jquery-3.0.0.min.js"></script>
 
 

Can you tell me what, if anything, am I missing from these?  Because the filterable missing icons and other UI elements makes the screen thus far look pretty ugly.

Also, when clicking on the filterable boxes, which should show dropdowns for filter criteria (Starts With, Contains, etc...) all I get instead is a javascript error: Uncaught TypeError: f.getClientRects is not a function

 

The error appears to be thrown by jquery, of which you'll see I am using version 3.0.0.

Any help, suggestions, or advice would be greatly appreciated.

 

 

Pavlina
Telerik team
 answered on 28 Jun 2016
1 answer
109 views

Hi,

Is it possible to have two Edit buttons in a Grid, One for In-Line edit & another for Edit in Pop-Up mode. Thanks,

Kostadin
Telerik team
 answered on 28 Jun 2016
2 answers
185 views
Does Id have to be an integer or it can be string?
It seems like in my case #=INVOICE# is getting value but it Read method to controller not sure why not getting called.

I tried looking at this example: http://demos.telerik.com/kendo-ui/grid/detailtemplate

    code:
    @(Html.Kendo().Grid<OpenInvoicesInfo>()
                  .Name("grid")
      .Columns(columns =>
      {
          columns.Bound(p => p.INVOICE).ClientTemplate("<input type='checkbox' value='#= INVOICE #' class='testclass' />").Width(4);
          columns.Bound(i => i.INVOICE).Width(15);
          ...     
      })
          .ClientDetailTemplateId("OrdersTemplate")
      .DataSource(dataSource => dataSource
          .Ajax()
          .PageSize(8)
          .Read(read => read.Action("GetOpenInvoices", "Maint", new { cust = Request.QueryString["cust"] }))
      )

    )

    <script id="OrdersTemplate" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<CustomerComments>()
                                .Name("grid_#=INVOICE#")
                .Columns(columns =>
                {
                    columns.Bound(o => o.INVOICE).Width(15);
                    columns.Bound(o => o.Comment).Width(40);
                })
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(10)
                    .Read(read => read.Action("GetCustomerComments", "Maint", new { invoices = "#=INVOICE#" }))
                )
                .Pageable()
                .Sortable()
                .ToClientTemplate()
    )
</script>
          
        Controller:
        public ActionResult GetCustomerComments([DataSourceRequest] DataSourceRequest request, string invoices)
        {

            List<JNI.Enterprise.Contracts.CustomerComments> customer = InvoiceService.GetCustomerComments(invoices);

            return Json(customer.ToDataSourceResult(request));
        }

I will really appreciate if someone can reply.
Does it only work if it is in entity framework.
I am calling GetCustomerComments from a stored procedure.
It is loading the first grid fine but not calling details grid's controller method.
Gaurav
Top achievements
Rank 1
 answered on 27 Jun 2016
1 answer
1.4K+ views

Hello,

I am having difficulty incorporating the tree view into an existing project. This is the error that I am getting: "jQuery(...).kendoTreeView is not a function". When the page loads, it shows the diagram without any problems, but the tree view is just the text: "Item 1" and "Item 2." There is no functionality and the data from the datasource does not appear.

The only script files being loaded are the mindfusion.diagramming.js and jquery-1.10.2.js, so maybe there are other script files that need to be loaded, which are being prevented from doing so? Or maybe the order of the jquery files in the layout are incorrect? Could someone please advise me on what to do?

Here is my layout:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
  
   
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/jquery")
 
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
    <link href="@Url.Content("~/Content/kendo/2016.2.607/kendo.common-bootstrap.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2016.2.607/kendo.mobile.all.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2016.2.607/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2016.2.607/kendo.bootstrap.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2016.2.607/kendo.dataviz.bootstrap.min.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/kendo/2016.2.607/jquery.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/2016.2.607/jszip.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/2016.2.607/kendo.all.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/2016.2.607/kendo.aspnetmvc.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"></script>
  
</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                 </ul>
            </div>
        </div>
    </div>
    <div class="container body-content">
        @RenderBody()
 
        <hr />
        <footer>
            <p>© @DateTime.Now.Year - My ASP.NET Application</p>
        </footer>
    </div>
    
</body>
</html>

 

And in my sample page:

@using MindFusion.Diagramming;
@using MindFusion.Diagramming.Mvc;
@using System.Drawing;
@using MindFusion.Diagramming.Layout;
@using SolidBrush = MindFusion.Drawing.SolidBrush;
@using LinearGradientBrush = MindFusion.Drawing.LinearGradientBrush;
@using Kendo.Mvc.UI;
@{
    // initialize the DiagramView control
    DiagramView view = new DiagramView("diagramView");
 
    Diagram diagram = view.Diagram;
    //Diagram's BackBrush property defines the default color with which the interior of the diagram will be filled
    diagram.BackBrush = new SolidBrush(Color.Azure);
    //LinkHeadShape and LinkHeadShapeSize properties define the default base shape and size for links' ending arrowhead
    diagram.LinkHeadShape = ArrowHeads.Triangle;
    diagram.LinkHeadShapeSize = 3;
 
    //DiagramStyle style = new DiagramStyle();
    //style.FontFamily = "Times New Roman";
    //style.Brush = new LinearGradientBrush(Color.LightBlue, Color.Blue, 90);
    //style.Stroke = new SolidBrush(Color.Black);
    //diagram.Style = style;
 
    Theme theme = new Theme();
    ShapeNodeStyle style = new ShapeNodeStyle();
    style.FontFamily = "Courier New";
    //Default fill color for shapes
    style.Brush = new LinearGradientBrush(Color.Pink, Color.Green, 90);
    theme.RegisterStyle(typeof(ShapeNode), style);
    diagram.Theme = theme;
 
    // add some nodes and links to the view's Diagram
    //ShapeNode objects can be drawn as various geometric shapes, as set through their Shape property.
    //The Shape property can be set to one of the predefined shapes: RoundRect, Rectangle, Ellipse, Process, Procedure, Delay
    ShapeNode node1 = diagram.Factory.CreateShapeNode(new RectangleF(55, 10, 40, 15));
    node1.Shape = Shapes.Terminator;
    node1.Text = "Start";
    node1.Tag = node1.Id;
    node1.Brush = new LinearGradientBrush(Color.Yellow, Color.Orange, 90);
 
    ShapeNode node2 = diagram.Factory.CreateShapeNode(new RectangleF(50, 40, 50, 20));
    node2.Text = "Receive order via e-mail";
    node2.Tag = node2.Id;
 
    ShapeNode node3 = diagram.Factory.CreateShapeNode(new RectangleF(50, 70, 50, 20));
    node3.Text = "Copy and paste e-mail data into database";
    node3.Tag = node3.Id;
 
    ShapeNode node4 = diagram.Factory.CreateShapeNode(new RectangleF(55, 100, 40, 40));
    node4.Shape = Shape.FromId("Decision");
    node4.Text = "Shipping involved?";
    node4.Brush = new LinearGradientBrush(Color.White, Color.Fuchsia, 90);
    node4.Tag = node4.Id;
 
    ShapeNode node5 = diagram.Factory.CreateShapeNode(new RectangleF(100, 135, 50, 20));
    node5.Shape = Shape.FromId("Save");
    node5.Text = "Print invoice and UPS label";
    node5.Brush = new SolidBrush(Color.Chartreuse);
    node5.Tag = node5.Id;
 
    ShapeNode node6 = diagram.Factory.CreateShapeNode(new RectangleF(100, 165, 50, 20));
    node6.Text = "Send e-mail to confirm shipping";
    node6.Tag = node6.Id;
    diagram.Nodes.Add(node6);
 
    ShapeNode node7 = diagram.Factory.CreateShapeNode(new RectangleF(100, 195, 50, 20));
    node7.Text = "Assemble package and ship";
    node7.Tag = node7.Id;
 
    ShapeNode node8 = diagram.Factory.CreateShapeNode(new RectangleF(55, 230, 40, 15));
    node8.Shape = Shapes.Terminator;
    node8.Text = "End";
    node8.Brush = new LinearGradientBrush(Color.Yellow, Color.Orange, 90);
    node8.Tag = node8.Id;
 
    diagram.Factory.CreateDiagramLink(node1, node2);
    diagram.Factory.CreateDiagramLink(node2, node3);
    diagram.Factory.CreateDiagramLink(node3, node4);
 
    //Add links
    DiagramLink link4 = diagram.Factory.CreateDiagramLink(node4, node5);
    link4.Text = "Yes";
 
    diagram.Factory.CreateDiagramLink(node5, node6);
    diagram.Factory.CreateDiagramLink(node6, node7);
    diagram.Factory.CreateDiagramLink(node7, node8);
 
    DiagramLink link8 = diagram.Factory.CreateDiagramLink(node4, node8);
    link8.Text = "No";
 
    ContainerNode node9 = diagram.Factory.CreateContainerNode(new RectangleF(200, 255, 100, 40));
    node9.Caption = "hi";
    node9.CaptionFormat.Alignment = StringAlignment.Center;
    node9.CaptionHeight = 12;
    node9.CaptionBrush = new SolidBrush(Color.Blue);
 
 
    diagram.Nodes.Add(node9);
    //Store the view in the ViewBag dictionary
    //Registers an object with the control
    ViewBag.DiagramView = view;
 
}
 
<div id="treeview-left">
 
    @(Html.Kendo().TreeView()
              .Name("treeview") //The name of the treeview is mandatory. It specifies the "id" attribute of the widget.
              .Items(items =>
              {
                  items.Add().Text("Item 1"); //Add item with text "Item1")
                  items.Add().Text("Item 2"); //Add item with text "Item2")
              })
               .Events(e => e
                    .Expand("treeview_expand")
                    .Collapse("treeview_collapse")
              )
    )
</div>
 
<script>
        function treeview_collapse() {
            //Handle the collapse event
        }
 
        function treeview_expand() {
            //Handle the expand event
        }
        $(document).ready(function () {
            $("#treeview-left").kendoTreeView({
                dragAndDrop: true,
                dataSource: [
                    {
                        text: "Furniture", expanded: true, items: [
                          { text: "Tables & Chairs" },
                          { text: "Sofas" },
                          { text: "Occasional Furniture" }
                        ]
                    },
                    {
                        text: "Decor", items: [
                          { text: "Bed Linen" },
                          { text: "Curtains & Blinds" },
                          { text: "Carpets" }
                        ]
                    }
                ]
            });
        });
 
</script>
 
 
 
@Html.DiagramView((DiagramView)ViewBag.DiagramView, new { style = "width:700px; height:500px" })

 

Dimo
Telerik team
 answered on 27 Jun 2016
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?