Telerik Forums
UI for ASP.NET MVC Forum
2 answers
888 views
Hello Telerik,
I need to access to a control defined in a different area from the one my page is currently in... for example if I'm in Admin area I want to access to a CommonController defined in the main Controller folder (so Area = null)

In the specific I'm using a dropdown but in future I'll use it for grid as well... my code is

@(Html.Kendo().DropDownList()
          .Name("cbAccount")
          .HtmlAttributes(new { style = "width: 250px" })
          .DataTextField("Descr")
          .DataValueField("ID")
          .DataSource(source =>
          {
              source.Read(read =>
              {
                  read.Action("GetListaAccount", "Common");
              }).ServerFiltering(false);
          })
    )
It looks for a Common controller under the Admin area...I've tried specifing the routeValues as new {Area=null} or new {Area="Foo"} but I don't even see the call to the service...what am I doing wrong?

Thanks
Paolo
Daniel
Telerik team
 answered on 28 Aug 2013
1 answer
102 views
I am using ASP.net MVC 4 with Kendo UI and have created a Kendo UI WIndow that contains a tab control, each containing a kendo list view.  The purpose of the window is to maintain system notes and activity within the application.  The tab control contains 3 tabs: Notes, Activity and All Notes and Activity.   The Notes tab allows a user to create and view  notes while the Activity and All Notes and Activity allows the user to view information only.
The problem I am having is when creating a note in IE 8.  For some reason, the request object sent to the controller does not contain the note entered by the user.  It is null even when text is entered on the screen.  The mystery here is it works great in IE 9, FireFox and Chrome. 

Has anyone had any issues with the request object not being populated in IE 8?

The View

@model IEnumerable<BlueJayPPE.ViewModels.RequestNoteViewModel>

<script type="text/x-kendo-tmpl" id="requestTemplateNote">
     <div class="request-note-view k-widget">
        <div  class="request-note"> 
                <b>#:Subject#</b>
                <p>#:Note#</p>

                 #if (IsOwner==true){#
                    <div class="request-note-buttons">
                        <div class="request-note-edit-button">
                            <a id="addButton" class="k-button k-button-icontext k-edit-button" href="\\#"><span class="k-icon k-edit"></span></a>
                            <a class="k-button k-button-icontext k-delete-button" href="\\#"><span class="k-icon k-delete"></span></a>
                        </div>
                    </div>
                #} else {#
                        <div class="request-note-buttons">
                        <div class="request-note-edit-button">
                            <div>
                                <span class="k-icon k-edit k-state-disabled" >
                            </div>
                            <div>
                                <span class="k-icon k-delete k-state-disabled" >
                            </div>
                          </div>
                    </div>
                #}#
        </div>
    </div>
    
</script>

<div class="request-note-section">

    <div class="request-note-section-button">
        <a class="k-button k-button-icontext k-add-button" href="#"><span class="k-icon k-add"></span>@ViewRes.CCE.AddNoteButtonLabel</a>
    </div>

        @(Html.Kendo().ListView<BlueJayPPE.ViewModels.RequestNoteViewModel>(Model)
        .Name("RequestNotesView")
        .TagName("div")
        .ClientTemplateId("requestTemplateNote")
        .DataSource(dataSource => dataSource
            .Model(model => {
                model.Id("RequestNoteId");
              })
            .Read(read => read.Action("GetRequestNotes", "ProposalEngine").Data("RequestLogActivity.getRequestNotesParams"))
            .Create(create => create.Action("AddNote", "ProposalEngine").Data("RequestLogActivity.getRequestNotesParams"))
            .Update(update => update.Action("UpdateNote", "ProposalEngine"))
            .Destroy(destroy => destroy.Action("DeleteNote", "ProposalEngine"))
           )
        .Editable(editable => editable.TemplateName("RequestNoteEdit"))
    )

</div>

<script>
    $(function() {
        var listView = $("#RequestNotesView").data("kendoListView");
        var dsRequestNote = $("#RequestNotesView").data("kendoListView").dataSource;

        dsRequestNote.bind("requestEnd", function (e) {

            var dsAllActivity = $('#RequestAllActivityView').data('kendoListView').dataSource;
            var responseErr = false;;

            if (e.type == "create")
            {
                try{
                    console.log(e.response.Data[0].RequestId);
                }
                catch (err) {
                    console.log("no request id");
                }

                try {
                    console.log(e.response.Data[0].Note);
                }
                catch (err) {
                    console.log("no note");
                }

                dsAllActivity.add({
                    RequestId: e.response.Data[0].RequestId,
                    RequestNoteId: e.response.Data[0].RequestNoteId,
                    NoteType: e.response.Data[0].NoteType,
                    Note: e.response.Data[0].Note,
                    CreatedByUserName: e.response.Data[0].CreatedByUserName,
                    Subject: e.response.Data[0].Subject
                });

                dsAllActivity.sync;
             }
            else if (e.type == "update"){

                var item = dsAllActivity.get(e.response.Data[0].RequestNoteId);

                item.set("Note", e.response.Data[0].Note);

                dsAllActivity.sync;
               
            }
            else if (e.type == "destroy")
            {
                dsAllData = dsAllActivity._data;

                for (var pos = 0; pos < dsAllData.length; pos++) {

                    if (dsAllData[pos].RequestNoteId == e.response.Data[0].RequestNoteId) {

                        dsAllActivity.remove(dsAllData[pos]);
                        dsAllActivity.sync;

                        break;
                    }
                }
            }
        });

        $(".k-add-button").click(function (e) {
    
            listView.add();
            e.preventDefault();
        });
       
        listView.bind("remove", function (e) {

            if (!confirm("Are you sure you want to delete this item?")) {
                e.preventDefault();
            }

        });

    });

</script>

The Controller (irrelevant actions removed for brievity)
public class EngineController : Controller
    {

        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult AddNote(int requestId, [DataSourceRequest] DataSourceRequest request, RequestNoteViewModel requestNote)
        {
            var results = new List<RequestNoteViewModel>();

            if (requestNote != null && ModelState.IsValid)
            {
                int webUserId = unchecked((int)User.WebUserKey());

                requestNote.RequestId = (requestId == 0 ? requestId : requestNote.RequestId);
                requestNote.IsOwner = true;


                var commitedNote = RequestNoteRepository.Insert(webUserId, requestNote);
      
                results.Add(commitedNote);
            }
            
            return Json(results.ToDataSourceResult(request, ModelState));
        }
       

    }

The View Model
public class RequestNoteViewModel
    {
        [Editable(false)]
        public int RequestId { get; set; }

        [Editable(false)]
        public int RequestNoteId { get; set; }

        [Editable(false)]
        public int CreatedByWebUserId { get; set; }

        [Editable(false)]
        public string CreatedByUserName { get; set; }

        [Editable(true)]
        [Required (AllowEmptyStrings = false, ErrorMessage = "A Numberic or Alpha Character is Required")]
        public string Note { get; set; }

        public string NoteType { get; set; }

        public string Action { get; set; }

        [Editable(false)]
        public DateTime CreatedDate { get; set; }

        public string Subject
        {
            get 
            { 
                if( NoteType == "log" ) {
                    return CreatedByUserName + " " + Action + " a request on " + CreatedDate;
                } else {
                    return CreatedByUserName + " created a note on " + CreatedDate;
                }
            }
            set { }
        }

        public bool IsOwner { get; set; }
    }
Petur Subev
Telerik team
 answered on 28 Aug 2013
2 answers
130 views
Hi All,

I'm trying to replicate the demo tabstrip animation functionality in my own project as a proof of concept project whilst trialing the controls.

However I'm getting the following error:

Object doesn't support property or method 'kendoTabStrip'

It's probably a setup issue but am not sure what I'm doing wrong.

Index.cshtml
<form class="configuration k-widget k-header">
    <span class="configHead">Animation Settings</span>
    <ul class="options">
        <li>
            <input name="animation" type="radio" @(ViewBag.animation == "toggle" ? "checked=\"checked\"" : "") value="toggle" /> <label for="toggle">toggle animation</label>
        </li>
        <li>
            <input name="animation" type="radio" @(ViewBag.animation != "toggle" ? "checked=\"checked\"" : "") value="expand" /> <label for="expand">expand animation</label>
        </li>
        <li>           
            @Html.CheckBox("opacity", (bool)ViewBag.opacity) <label for="opacity">animate opacity</label>
        </li>
    </ul>
 
    <button class="k-button">Apply</button>
</form>
 
<h3>Conversation history</h3>
 
@(Html.Kendo().TabStrip()
    .Name("tabstrip")
    .HtmlAttributes(new { style = "width:500px" })
    .Animation(animation =>
    {
        animation.Enable(ViewBag.animation == "expand" || ViewBag.opacity);
 
        animation.Open(config =>
        {
            if (ViewBag.animation != "toggle")
            {
                config.Expand();
            }
 
            if (ViewBag.opacity == true)
            {
                config.Fade(FadeDirection.In);
            }
 
            config.Duration(AnimationDuration.Fast);
        });
    })
    .SelectedIndex(0)
    .Items(panelbar =>
    {
        panelbar.Add().Text("First Tab")
                .Content(@<text>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer felis libero, lobortis ac rutrum quis, varius a velit. Donec lacus erat, cursus sed porta quis, adipiscing et ligula. Duis volutpat, sem pharetra accumsan pharetra, mi ligula cursus felis, ac aliquet leo diam eget risus. Integer facilisis, justo cursus venenatis vehicula, massa nisl tempor sem, in ullamcorper neque mauris in orci.</p>
                </text>);
 
        panelbar.Add().Text("Second Tab")
                .Content(@<text>
                    <p>Ut orci ligula, varius ac consequat in, rhoncus in dolor. Mauris pulvinar molestie accumsan. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean velit ligula, pharetra quis aliquam sed, scelerisque sed sapien. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aliquam dui mi, vulputate vitae pulvinar ac, condimentum sed eros.</p>
                </text>);
     
        panelbar.Add().Text("Third Tab")
                .Content(@<text>
                    <p>Aliquam at nisl quis est adipiscing bibendum. Nam malesuada eros facilisis arcu vulputate at aliquam nunc tempor. In commodo scelerisque enim, eget sodales lorem condimentum rutrum. Phasellus sem metus, ultricies at commodo in, tristique non est. Morbi vel mauris eget mauris commodo elementum. Nam eget libero lacus, ut sollicitudin ante. Nam odio quam, suscipit a fringilla eget, dignissim nec arcu. Donec tristique arcu ut sapien elementum pellentesque.</p>
                </text>);
     
        panelbar.Add().Text("Fourth Tab")
                .Content(@<text>
                    <p>Maecenas vitae eros vel enim molestie cursus. Proin ut lacinia ipsum. Nam at elit arcu, at porttitor ipsum. Praesent id viverra lorem. Nam lacinia elementum fermentum. Nulla facilisi. Nulla bibendum erat sed sem interdum suscipit. Vestibulum eget molestie leo. Aliquam erat volutpat. Ut sed nulla libero. Suspendisse id euismod quam. Aliquam interdum turpis vitae purus consectetur in pulvinar libero accumsan. In id augue dui, ac volutpat ante. Suspendisse purus est, ullamcorper id bibendum sed, placerat id leo.</p>
                </text>);
     
        panelbar.Add().Text("Fifth Tab")
                .Content(@<text>
                    <p>Fusce nec mauris enim, non pharetra neque. Etiam elementum nunc ut velit fermentum sed porta eros dignissim. Duis at nisl eros. Integer arcu nisl, accumsan non molestie at, elementum nec odio. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque arcu odio, aliquam vel viverra ac, varius at sapien. Nullam elementum nulla non libero interdum vestibulum at in lacus. Curabitur ac magna ac lacus dapibus convallis non at turpis.</p>
                </text>);
    })
)


HomeController
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
 
namespace BizSpark.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/
 
        public ActionResult Index(string animation, bool? opacity)
        {
            ViewBag.animation = animation ?? "expand";
            ViewBag.opacity = opacity ?? true;
 
            return View();
        }
 
    }
}
_Layout.cshtml
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
     @Styles.Render("~/Content/kendo/css")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/kendo")
</head>
<body>
    @RenderBody()
 
    
    @RenderSection("scripts", required: false)
</body>
</html>
BundleConfig.cs
    public class BundleConfig
    {
        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js"));
 
            bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                        "~/Scripts/jquery-ui-{version}.js"));
 
            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.unobtrusive*",
                        "~/Scripts/jquery.validate*"));
 
            // Use the development version of Modernizr to develop with and learn from. Then, when you're
            // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"));
 
 
            bundles.Add(new ScriptBundle("~/bundles/kendo")
     .Include("~/Scripts/kendo.all.min.js") // or kendo.all.min.js  kendo.web.min.js
     .Include("~/Scripts/kendo.aspnetmvc.min.js")
);
 
 
            bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
 
            bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                        "~/Content/themes/base/jquery.ui.core.css",
                        "~/Content/themes/base/jquery.ui.resizable.css",
                        "~/Content/themes/base/jquery.ui.selectable.css",
                        "~/Content/themes/base/jquery.ui.accordion.css",
                        "~/Content/themes/base/jquery.ui.autocomplete.css",
                        "~/Content/themes/base/jquery.ui.button.css",
                        "~/Content/themes/base/jquery.ui.dialog.css",
                        "~/Content/themes/base/jquery.ui.slider.css",
                        "~/Content/themes/base/jquery.ui.tabs.css",
                        "~/Content/themes/base/jquery.ui.datepicker.css",
                        "~/Content/themes/base/jquery.ui.progressbar.css",
                        "~/Content/themes/base/jquery.ui.theme.css"));
 
 
            // The Kendo CSS bundle - replace "2012.3.1315" with the Kendo UI version that you are using
            bundles.Add(new StyleBundle("~/Content/css")
                  .Include("~/Content/kendo.common.*")
                  .Include("~/Content/kendo.uniform.min.*")
            );
        }
    }
}


Any help is appreciated, thanks.
Mark
Top achievements
Rank 1
 answered on 28 Aug 2013
6 answers
218 views
I have attached a view.  It has three DropDownLists and a Grid.  Two of the DropDownLists provide values which filter the third and the Grid.  If I change a value in either of the two filtering lists, the third list and the grid change accordingly.  This all works just fine.  The grid often has more than one page, and I can change pages however I want, no problem.  However, if the grid has more than one page, and I change the page, then just select either of the two filtering lists, kendo/2013.1.514/jquery.min.js throws an error, saying o.activeElement is an “Unspecified error”.  This happens every time I follow this scenario.  By inserting an alert at the top of the lists' Change event handler, I can see that the error occurs before it even gets there.

I don't expect it to be helpful, but I copied the Call Stack here:
 trigger [jquery.min.js] Line 3
  trigger [jquery.min.js] Line 3
  Anonymous Function [jquery.min.js] Line 4
  each [jquery.min.js] Line 3
  each [jquery.min.js] Line 3
  trigger [jquery.min.js] Line 4
  Anonymous Function [jquery.min.js] Line 5
  _toggle [kendo.all.min.js] Line 14
  toggle [kendo.all.min.js] Line 15
  Anonymous Function [kendo.all.min.js] Line 15
  dispatch [jquery.min.js] Line 3
  handle [jquery.min.js] Line 3
Petur Subev
Telerik team
 answered on 28 Aug 2013
2 answers
127 views
Hello,

I have a treeview populated with some data. 

When you click on a node, it fires an ajax request and populates a PanelBar with the content.
each panel bar item then fires another request when clicked to load more data into a grid.

The issue is that on each click on a panel bar item, only one ajax request should fire. 
So click on a node in tree, you see the panel bar, click on an item and one request fires for the grid.
Click on another item in the tree, click on panel bar and then 2 requests fire.
click a third time and we'll notice 3 requests firing.

Somehow there seems to be a relation between how many calls the panel bar triggers and how many items in the tree were clicked.
I attached a test project to demonstrate the issue. 

Any idea why more than 1 request is fired when clicking on a PanelBar item and what can  I do to stop it ?
Shaun
Top achievements
Rank 1
 answered on 28 Aug 2013
3 answers
742 views
Hello,

i'm searching for a way to implement a custom binding for Sorting, Paging, Grouping and Filters within a grid but i just found informations for sorting and paging.

I've done a look into this http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/custom-binding post but it would only handle the soring and paging stuff.

It sould be possible to handle the grouping and filtering stuff as well without the .ToDataSourceResult(request); right?

Any help to figure this out would be welcome :-)

Kind Regards
Daniel

 
Rosen
Telerik team
 answered on 28 Aug 2013
3 answers
844 views
Hello every one, I m using Kendo Grid on MVC, it is configured for inline editing. here is the sample code


01.@(Html.Kendo().Grid<Sanwin.ViewModels.Customer.CustomerInfoModel>()
02..Name("user-Grid")
03..EnableCustomBinding(true)
04.//.BindTo(Model.Customers)
05.  .Events(ev=>ev.Edit("edit"))
06..Columns(columns =>
07.{
08.    
09.    columns.Bound(p => p.FirstName).Width(150).Title("First Name");
10.    columns.Bound(p => p.LastName).Width(150).Title("Last Name");
11.    columns.Bound(p => p.Email).Width(150).Title("Email");
12. 
13.    columns.Bound(p => p.Ranking).Width(150).Title("Ranking");
14.   // columns.ForeignKey(p => p.RankingId, rankingList,"Value","Text").Width(150).Title("Ranking");
15.    columns.Bound(p => p.Gender1).Title("Gender");
16.  
17.    columns.Bound(x => x.UserName).Width(100);
18.    columns.Bound(x => x.Password).Width(100);
19.   
20.     
21.    columns.Command(command => { command.Edit(); command.Destroy(); }).Width(100).Title("Action");
22.})
23..ToolBar(toolBar => toolBar.Create())
24..Editable(editable => editable.Mode(GridEditMode.InLine))
25..Pageable()
26..Sortable()
27. 
28.        .DataSource(dataSource => dataSource
29.            .Ajax()
30.            .Events(events => events.Error("error_handler"))
31.            .Model(model => model.Id(p => p.Id))
32.                                    .Create(update => update.Action("EditingInline_Create", "Customer", ViewBag.CustomerInfoModel))
33.            .Read(read => read.Action("UsersList", "Customer"))
34.                    .Update(update => update.Action("EditingInline_Update", "Customer"))
35.                    .Destroy(update => update.Action("EditingInline_Destroy", "Customer"))

37.        ))
On line number 13, we have a column called Ranking, that is a editor template, here is the code for that
Raanking template
01.@using System.Web.Mvc;
02.@using Kendo.Mvc.UI;
03.@using Sanwin.Services.Catalog;
04. 
05.@model string
06. 
07.@{
08.    var _rankingService = DependencyResolver.Current.GetService<IRankingService>();
09.     var rankings = _rankingService.GetAllRanking().Select(c => new { Id = c.Rankings, Name = c.DisplayText }).ToList();
10.            rankings.Insert(0, new { Id = 0, Name = "--select--" });
11.             
12.            var rankingList=new List<SelectListItem>();
13.            foreach(var r in rankings)
14.            {
15.                rankingList.Add(new SelectListItem
16.                {
17.                    Text=r.Name,
18.                    Value=r.Id.ToString()
19.                });  
20.            }
21.}
22.@*@(Html.Kendo().DropDownList().Name("Ranking").DataSource(
23.ds=>ds.Read("RankingList","Catalog")
24.    )
25.    //.SelectedIndex(0)
26.    .DataTextField("Name").DataValueField("Id")
27.    //.Value(Model.ToString())
28.    )*@
29. 
30.@(Html.Kendo().DropDownList().Name("Ranking").BindTo(rankingList)
31.    )
On my model I have this
1.[UIHint("Ranking")]
2.       public string Ranking { get; set; }

 on coltroller
01.for (int i = 0; i < customers.Count; i++)
02.           {
03.               if (!customerIds.Contains(customers[i].Id))
04.               {
05.                   Customer manager = null;
06.                   string siteName = "";
07.                   if (customers[i].ManagerCustomerId.HasValue && customers[i].ManagerCustomerId > 0)
08.                   {
09.                       manager = _customerService.GetCustomerById(customers[i].ManagerCustomerId.Value);
10.                       siteName = manager.EntityId.HasValue ? _customerService.GetEntityById(manager.EntityId.Value).Title : string.Empty;
11.                   }
12.                   var customermodel = new CustomerInfoModel
13.                   {
14.                       Id = customers[i].Id,
15.                       Email = customers[i].Email,
16.                       UserName = customers[i].UserName,
17.                       Active = customers[i].IsActive,
18.                       FirstName = customers[i].FirstName,
19.                       LastName = customers[i].LastName,
20.                       Ranking = customers[i].Ranking.HasValue && customers[i].Ranking.Value > 0 ? _rankingService.GetRankingByRank(customers[i].Ranking.Value).DisplayText : "",
21.                       GroupName = customers[i].CustomerGroups.FirstOrDefault() != null ? customers[i].CustomerGroups.FirstOrDefault().Group.Name : string.Empty,
22.                       Manager = manager != null ? siteName + "-" + manager.UserName : string.Empty,
23.                       Gender1 = customers[i].Gender,
24.                       RankingId = customers[i].Ranking.HasValue ? customers[i].Ranking.Value : 0,
25. 
26.                   };
27.                   customerInfoModel.Add(customermodel);
28.                   customerIds.Add(customers[i].Id);
29.               }
30.           }
31. 
32. 
33. 
34.           return Json(customerInfoModel.ToDataSourceResult(request));

My problem is that, the grid is working fine, except only on edit mode, on edit mode, the ranking should display a dropdownlist, it is ok, but it is not retaining its value, I mean if on normal mode, its value is Ranking3, on edit mode, the dropdown should have selected item with Ranking3, but is not highlighting that item.

I have also tried the foreign key column type, but the result is same.

What wrong I m doing here, please correct me. Its really Urgent.
Daniel
Telerik team
 answered on 28 Aug 2013
1 answer
395 views
I want to change confirmation popup from synchronous browser popup to asynchronous popup (alertify). I found some old threads in Telerik MVC Extensions (http://www.telerik.com/community/forums/aspnet-mvc/grid/delete-a-row-programmatically.aspx), but this code is not working for me.

How can I delete row programatically?
I already attached to Delete event and prevent remove row, but I can't remove it programatically on positive confirmation callback (callback was called but nothing happens).

How prevent deleting row in client side too? - return false or e.preventDefault cancel remote delete call but row was removed from view.

Here is my javascript delete handler code:
function deleteRow(e) {/* How prevent delete row in client side too - return false or e.preventDefault cancel remote delete call but row was removed from view */
    alertify.confirm("dddd", function(result) {
        if (result) {
            e.sender.removeRow(e.row); /* not removing row */
        }
    });
    return false;
}
Here is grid MVC builder code:
@(Html.Kendo().Grid(Model.Franchises)
                     .Name("franchisesGrid")
                     .Columns(columns =>
                                  {
                                      columns.Bound(p => p.Name);
                                      columns.Bound(p => p.CompanyName);
                                      columns.Command(command =>
                                                          {
                                                              command.Edit().Text(LocalizationResources.Update).CancelText(LocalizationResources.Cancel).UpdateText(LocalizationResources.OK);
                                                              command.Destroy().Text(LocalizationResources.Remove);
                                                          });
                                  })
                     .Groupable()
                     .Pageable()
                     .Sortable()
                     .Scrollable()
                     .Filterable()
                     .ColumnMenu()
                     .ToolBar(toolbar =>
                                  {
                                      toolbar.Template(@<text>
                                                            <div class="row control-group">
                                                                <div class="span10">
                                                                    <a class="btn k-btn-add k-grid-add"><span class="k-icon k-add"></span>@LocalizationResources.Create</a>
                                                                </div>
                                                            </div>
                                                        </text>);
                                  })
                     .Resizable(resize => resize.Columns(true))
                     .Reorderable(reorder => reorder.Columns(true))
                     .Editable(editable =>
                                   {
                                       editable.Mode(GridEditMode.PopUp).Window(builder => builder.Title("Title"));
                                       editable.DisplayDeleteConfirmation(false);
                                   })
                     .Events(builder => builder.Remove("deleteRow"))
                     .DataSource(dataSource => dataSource
                                                   .Ajax()
                                                   .Events(events => events.Error("error_handler"))
                                                   .Model(model => model.Id(p => p.Id))
                                                   .Read("Get", "Home")
                                                   .Create("Create", "Home")
                                                   .Update("Update", "Home")
                                                   .Destroy("Remove", "Home")))
Alexander Popov
Telerik team
 answered on 27 Aug 2013
6 answers
240 views
Hi,

I have an existing legacy MVC project where I use Telerik MVC extensions. I'm now trying to migrate it to Kendo UI.
I have a little problem with scatter charts with uses ajax binding. If I have a single series, it works fine. But if I have more than one, it doesn't. This was working quite well in MVC extensions.

When I put a put a breakpoint in firebug, I see that chart.options.series[].data in case of a single series has a collection of objects which represent each data point. But in case of 2 series,
each chart.options.series[].data seems to have another array of 2 objects and inside it the data points. So my chart seems to have 4 sets of data for 2 series. I'm attaching a sample project.

Secondly I'd like the Kendo equivalent for these snippets of code

1.  .YAxis(y => y.Numeric().MinorTickType(ChartAxisTickType.Outside))

2.
function formatXAxis(value) {
        var hr = Math.floor(value);
        var min = value - hr;
        var newval = hr + (min * 6 / 10);
 
        return $.telerik.formatString('{0:N}', newval).replace('.', ':').replace(',', ':');
    }


Thanks and Regards

Achilles
Achilles
Top achievements
Rank 1
 answered on 27 Aug 2013
3 answers
97 views
I reffered the below link to create a asp.net mvc3 project with kendo UI
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/introduction
I use razor view. my index page is as follows

Index.cshtml
@{
Layout = null;
}

<!DOCTYPE html>

<html>
<head>
<title>Index</title>
<link href="../../KendoStyles/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="../../KendoStyles/kendo.default.min.css" rel="stylesheet" type="text/css" />

<script src="../../KendoScripts/jquery.min.js" type="text/javascript"></script>
@*<script src="../../KendoScripts/kendo.all.min.js" type="text/javascript"></script>*@
<script src="../../KendoScripts/kendo.web.min.js" type="text/javascript"></script>
<script src="../../KendoScripts/kendo.aspnetmvc.min.js" type="text/javascript"></script>

</head>
<body>
<h1>Welcome to Kendo Samples</h1>
<div>
@(Html.Kendo().DatePicker().Name("Birthday"))
</div>
</body>
</html>

when i use kendo.web.min.js i get the error "Microsoft JScript runtime error: Unable to get value of the property 'extend': object is null or undefined"
with kendo.all.min.js it works fine. I get no error message.

What is wrong with my code if any?
Venkatesh
Top achievements
Rank 1
 answered on 27 Aug 2013
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?