Telerik Forums
UI for ASP.NET MVC Forum
4 answers
279 views
So I have a grid that is populated from EF5
@model IEnumerable<HCS.Model.FinancialInstitution>
@(Html.Kendo().Grid(Model)
                .Name("Grid")
                .Columns(columns =>
                {
                    columns.Bound(p => p.ID).Visible(false);
                    columns.Bound(p => p.MainRT).Title("RT").Groupable(false);
                    columns.Bound(p => p.LegalName).Title("FI Name");
                })
                .Sortable()
                .Scrollable()
                .Filterable()
                .Selectable()                              
                .DataSource(dataSource => dataSource
                            .Ajax()
                            .ServerOperation(false))
                             
)
I recently added a new table to the database that has a FK to the FinancialInstitution table
I updated the model and the association and navigation are now present.

However, now I get the following error:

"A circular reference was detected while serializing an object of type 'System.Data.Entity.DynamicProxies.FinancialInstitution_1..."
 
I have found a few articles suggesting the disabling of proxy creation, but this doesn't seem to help.
public ActionResult Grid()
        {
            context.Configuration.ProxyCreationEnabled = false;
            var model = context.FinancialInstitutions.ToList();
            return View();
        }
 I also found a blog that suggests a workaround however, I am confused as to whether or not I will have to do something every time a call is made to EF to rewire the JSON results
Bob
Top achievements
Rank 1
 answered on 03 Dec 2013
1 answer
139 views
I have a grid that  I am displaying and I am trying 2 different methods....  The jquery version works and displays the data in the grid...

In Fiddler, I can see the return JSON and everything looks as it should in the browser 

 var url = "/memo/a/8/b/1";  // build URL to API

            var dataSource = new kendo.data.DataSource({    // create datasource
                transport: {
                    read: {
                        url: url,
                        dataType: "json",
                    }
                }
            });

When I try the same call using Razor (my preferred way), this will not display any data in the grid.   I see in Fiddler the exact same return JSON as as the Jquery method above.  But no data is being displayed.   Any suggestions?

@(Html.Kendo().Grid<eWJB.Models.MemoModel>()
    .Name("grid1")
    .Columns(columns =>
        {
            columns.Bound(p => p.MemoID);
            columns.Bound(p => p.Subject).Width(100).Title("Subject");
            columns.Bound(p => p.Initials).Width(30).Title("Initials");

    })
    .DataSource(dataSource => dataSource
        .Ajax()
       .Read(read => read.Url(Url.RouteUrl("GetAllMemos",  new {httproute ="", controller="Memo", branch=1, id=8 })).Type(HttpVerbs.Get))
         )
    .Sortable()
    .Scrollable()
    
)
Vladimir Iliev
Telerik team
 answered on 03 Dec 2013
2 answers
957 views
I'm at a lost. I've attempted to run my "Batch editing" grid with MVC3 and I keep receiving this error:
 "A circular reference was detected while serializing an object of type 'System.Data.Entity.DynamicProxies.aspnet_Users_8928C46E971F379B4E2E99263A0AD4EE44DD31017D7C2242241BF00A73BA81B3'."

 I've read other forums such as :

http://stackoverflow.com/questions/12845016/kendo-ui-invalidoperationexception-a-circular-reference-was-detected-while-se
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/faq#how-do-i-avoid-circular-reference-exceptions?

I understand I can't reference a circular reference from my model in the controller or view, which I'm not and I keep receiving this error. 

I'm also using Linq with the model first approach, but I do use a metadata model to add attributes to the models fields. 
Here is some of my code.

CaseController.cs
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CustomerService.Models;
using System.Web.Security;
using System.Security.Principal;
using Kendo.Mvc.UI;
using Kendo.Mvc.Extensions;
 
namespace CustomerService.Controllers
{
    [Authorize]
    public class CaseController : Controller
    {
        private ERPEntities db = new ERPEntities();
 
        public ActionResult Cases_Read([DataSourceRequest]DataSourceRequest request)
        {
                IQueryable<CaseHeader> cases = db.CaseHeaders;
                DataSourceResult result = cases.ToDataSourceResult(request);
                return Json(result, JsonRequestBehavior.AllowGet);
        }
 
        public ActionResult Cases_Create([DataSourceRequest]DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<CaseHeader> cases)
        {
            // Will keep the inserted entitites here. Used to return the result later.
            var entities = new List<CaseHeader>();
            if (ModelState.IsValid)
            {
                foreach (var x in cases)
                {
                    // Create a new Product entity and set its properties from the posted ProductViewModel
                    var entity = new CaseHeader
                    {
                        CaseHeaderId = x.CaseHeaderId,
                        Creator = x.Creator,
                        CreatedDate = x.CreatedDate,
                        CaseLead = x.CaseLead,
                        CaseSubType1 = x.CaseSubType1,
                        CaseSubType2 = x.CaseSubType2,
                        CaseStatus = x.CaseStatus,
                        CaseTitle = x.CaseTitle,
                        CaseDescription = x.CaseDescription,
                        CaseContact = x.CaseContact
                    };
                    // Add the entity
                    db.CaseHeaders.Add(entity);
                    // Store the entity for later use
                    entities.Add(entity);
                }
                // Insert the entities in the database
                db.SaveChanges();
                 
            }
            // Return the inserted entities. The grid needs the generated ProductID. Also return any validation errors.
            return Json(entities.ToDataSourceResult(request, ModelState, x => new CaseHeader
            {
                CaseHeaderId = x.CaseHeaderId,
                Creator = x.Creator,
                CreatedDate = x.CreatedDate,
                CaseLead = x.CaseLead,
                CaseSubType1 = x.CaseSubType1,
                CaseSubType2 = x.CaseSubType2,
                CaseStatus = x.CaseStatus,
                CaseTitle = x.CaseTitle,
                CaseDescription = x.CaseDescription,
                CaseContact = x.CaseContact
            }));
        }
 
        public ActionResult Cases_Update([DataSourceRequest]DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<CaseHeader> cases)
        {
            // Will keep the updated entitites here. Used to return the result later.
            var entities = new List<CaseHeader>();
            if (ModelState.IsValid)
            {
                foreach (var x in cases)
                {
                    // Create a new Product entity and set its properties from the posted ProductViewModel
                    var entity = new CaseHeader
                    {
                        CaseHeaderId = x.CaseHeaderId,
                        Creator = x.Creator,
                        CreatedDate = x.CreatedDate,
                        CaseLead = x.CaseLead,
                        CaseSubType1 = x.CaseSubType1,
                        CaseSubType2 = x.CaseSubType2,
                        CaseStatus = x.CaseStatus,
                        CaseTitle = x.CaseTitle,
                        CaseDescription = x.CaseDescription,
                        CaseContact = x.CaseContact
                    };
                    // Store the entity for later use
                    entities.Add(entity);
                    // Attach the entity
                    db.CaseHeaders.Attach(entity);
                    // Change its state to Modified so Entity Framework can update the existing product instead of creating a new one
                    db.Entry(entity).State = EntityState.Modified;
                    // Or use ObjectStateManager if using a previous version of Entity Framework
                    // northwind.ObjectStateManager.ChangeObjectState(entity, EntityState.Modified);
                }
                // Update the entities in the database
                db.SaveChanges();
            }
            // Return the updated entities. Also return any validation errors.
            return Json(entities.ToDataSourceResult(request, ModelState, x => new CaseHeader
            {
                CaseHeaderId = x.CaseHeaderId,
                Creator = x.Creator,
                CreatedDate = x.CreatedDate,
                CaseLead = x.CaseLead,
                CaseSubType1 = x.CaseSubType1,
                CaseSubType2 = x.CaseSubType2,
                CaseStatus = x.CaseStatus,
                CaseTitle = x.CaseTitle,
                CaseDescription = x.CaseDescription,
                CaseContact = x.CaseContact
            }));
        }
 
        public ActionResult Cases_Destroy([DataSourceRequest]DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<CaseHeader> cases)
        {
            // Will keep the destroyed entitites here. Used to return the result later.
            var entities = new List<CaseHeader>();
            if (ModelState.IsValid)
            {
                foreach (var x in cases)
                {
                    // Create a new Product entity and set its properties from the posted ProductViewModel
                    var entity = new CaseHeader
                    {
                        CaseHeaderId = x.CaseHeaderId,
                        Creator = x.Creator,
                        CreatedDate = x.CreatedDate,
                        CaseLead = x.CaseLead,
                        CaseSubType1 = x.CaseSubType1,
                        CaseSubType2 = x.CaseSubType2,
                        CaseStatus = x.CaseStatus,
                        CaseTitle = x.CaseTitle,
                        CaseDescription = x.CaseDescription,
                        CaseContact = x.CaseContact
                    };
                    // Store the entity for later use
                    entities.Add(entity);
                    // Attach the entity
                    db.CaseHeaders.Attach(entity);
                    // Delete the entity
                    db.CaseHeaders.Remove(entity);
                    // Or use DeleteObject if using a previous versoin of Entity Framework
                    // northwind.Products.DeleteObject(entity);
                }
                // Delete the entity in the database
                db.SaveChanges();
            }
            // Return the destroyed entities. Also return any validation errors.
            return Json(entities.ToDataSourceResult(request, ModelState, x => new CaseHeader
            {
                CaseHeaderId = x.CaseHeaderId,
                Creator = x.Creator,
                CreatedDate = x.CreatedDate,
                CaseLead = x.CaseLead,
                CaseSubType1 = x.CaseSubType1,
                CaseSubType2 = x.CaseSubType2,
                CaseStatus = x.CaseStatus,
                CaseTitle = x.CaseTitle,
                CaseDescription = x.CaseDescription,
                CaseContact = x.CaseContact
            }));
        }
    }
}

Index.cshtml

@model IEnumerable<CustomerService.Models.CaseHeader>
 
@{
    ViewBag.Title = "Index";
}
 
<h2>Your Cases</h2>
 
 
@(Html.Kendo().Grid<CustomerService.Models.CaseHeader>()
      .Name("grid")
      .Columns(columns =>
      {
          columns.Bound(x => x.CaseHeaderId);
          columns.Bound(x => x.Creator);
          columns.Bound(x => x.CreatedDate);
          columns.Bound(x => x.CaseLead);
          columns.Bound(x => x.CaseType);
          columns.Bound(x => x.CaseSubType1);
          columns.Bound(x => x.CaseSubType2);
          columns.Bound(x => x.CaseStatus);
          columns.Bound(x => x.CaseTitle);
          columns.Bound(x => x.CaseDescription);
          columns.Bound(x => x.CaseContact);
          columns.Command(commands =>
          {
              commands.Destroy(); // The "destroy" command removes data items
          }).Title("Commands").Width(200);
      })
      .ToolBar(toolbar =>
      {
          toolbar.Create(); // The "create" command adds new data items
          toolbar.Save(); // The "save" command saves the changed data items
      })
      .Editable(editable => editable.Mode(GridEditMode.InCell)) // Use in-cell editing mode
      .DataSource(dataSource =>
          dataSource.Ajax()
            .Batch(true) // Enable batch updates
            .Model(model =>
            {
                model.Id(x => x.CaseHeaderId); // Specify the property which is the unique identifier of the model
                model.Field(x => x.CaseHeaderId).Editable(false); // Make the CaseHeaderId property not editable
                model.Field(x => x.CreatedDate).Editable(false);
            })
            .Create(create => create.Action("Cases_Create", "Case")) // Action method invoked when the user saves a new data item
            .Read(read => read.Action("Cases_Read", "Case"))  // Action method invoked when the grid needs data
            .Update(update => update.Action("Cases_Update", "Case"))  // Action method invoked when the user saves an updated data item
            .Destroy(destroy => destroy.Action("Cases_Destroy", "Case")) // Action method invoked when the user removes a data item
      )
      .Pageable()
)

CaseHeader.cs  
using System;
using System.Collections.Generic;
 
namespace CustomerService.Models
{
    public partial class CaseHeader
    {
        public CaseHeader()
        {
            this.Notes = new HashSet<Note>();
        }
     
        public System.Guid CaseHeaderId { get; set; }
        public System.Guid UserId { get; set; }
        public string Creator { get; set; }
        public Nullable<System.DateTime> CreatedDate { get; set; }
        public string CaseLead { get; set; }
        public string CaseType { get; set; }
        public string CaseSubType1 { get; set; }
        public string CaseSubType2 { get; set; }
        public string CaseStatus { get; set; }
        public string CaseTitle { get; set; }
        public string CaseDescription { get; set; }
        public string CaseContact { get; set; }
     
        public virtual aspnet_Users aspnet_Users { get; set; }
        public virtual ICollection<Note> Notes { get; set; }
    }
     
}
Metadata for this model (I'm not really sure if this matters but I'm not sure) - ValidateModels.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
 
namespace CustomerService.Models
{
    [MetadataType(typeof(CaseHeaderMetaData))]
    public partial class CaseHeader
    {
    }
 
    public class CaseHeaderMetaData
    {
        public System.Guid CaseHeaderId { get; set; }
        public System.Guid UserId { get; set; }
        [MaxLength(50, ErrorMessage = "Too Long!")]
        public string Creator { get; set; }
        public Nullable<System.DateTime> CreatedDate { get; set; }
        public string CaseLead { get; set; }
        public string CaseType { get; set; }
        public string CaseSubType1 { get; set; }
        public string CaseSubType2 { get; set; }
        public string CaseStatus { get; set; }
        public string CaseTitle { get; set; }
        public string CaseDescription { get; set; }
        public string CaseContact { get; set; }
 
        public virtual aspnet_Users aspnet_Users { get; set; }
        public virtual ICollection<Note> Notes { get; set; }
    }
 
    [MetadataType(typeof(UserProfileMetaData))]
    public partial class UserProfile
    {
    }
 
    public class UserProfileMetaData
    {
        public System.Guid UserId { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        [Display(Name = "Request Company")]
        public string Company { get; set; }
        public string CompanyNumber { get; set; }
 
        public virtual aspnet_Users aspnet_Users { get; set; }
    }
     
}
Any thoughts or ideas about how to fix this problem are greatly appreciated.
Thanks
 
Atanas Korchev
Telerik team
 answered on 03 Dec 2013
1 answer
207 views
I just updated my solution to the latest release of Kendo and the MVC wrappers. Everything is working exactly as it did before except the tool tip which is now throwing the following error. Does anyone know why this has started and what the solution is? Included first is my code, and then the error thrown.

<div id="quick-menu">
    <ul>
        <li id="qm-progress">
            <a href="#">@this.GetTermProvider().GetValue("PROGRESS_LEGEND")</a>
        </li>
        <li id="qm-status">
            <a href="#">@this.GetTermProvider().GetValue("STATUS_LEGEND")</a>
        </li>
        <li id="qm-message">
            <a href="#">@this.GetTermProvider().GetValue("MESSAGES")</a>
        </li>
    </ul>
</div>

<script id="qm-progress-template" type="text/x-kendo-template">
    @Html.Action("QuickMenuProgress", "Shared")
</script>


@(Html.Kendo().Tooltip()
      .For("#qm-progress")
      .Filter("a")        
      .ContentTemplateId("qm-progress-template")
      .Position(TooltipPosition.Top)
      .Deferred()
      .Width(250)
      .Height(100)
)


@(Html.Kendo().Tooltip()
      .For("#qm-status")
      .Filter("a")        
      .ContentTemplateId("qm-status-template")
      .Position(TooltipPosition.Top)
      .Deferred()
      .Width(250)
      .Height(100)
)

<script id="qm-status-template" type="text/x-kendo-template">
    @Html.Action("QuickMenuStatus", "Shared")
</script>

------------------------------

Server Error in '/' Application.Key cannot be null.
Parameter name: keyDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentNullException: Key cannot be null.
Parameter name: key

Source Error: 

Line 19:
Line 20:
Line 21: @(Html.Kendo().Tooltip()
Line 22: .For("#qm-progress")
Line 23: .Filter("a")
Source File: c:\EPM\v6.0\Source\Presentation\Web\Views\Shared\QuickMenu.cshtml    Line: 21 

Stack Trace: 

[ArgumentNullException: Key cannot be null.
Parameter name: key]
System.Collections.Hashtable.ContainsKey(Object key) +149
System.Collections.Hashtable.Contains(Object key) +38
System.Collections.Specialized.OrderedDictionary.set_Item(Object key, Object value) +136
Kendo.Mvc.UI.WidgetBase.AppendScriptToContext(String script) +263
Kendo.Mvc.UI.WidgetBase.WriteDeferredScriptInitialization() +110
Kendo.Mvc.UI.WidgetBase.WriteHtml(HtmlTextWriter writer) +82
Kendo.Mvc.UI.WidgetBase.ToHtmlString() +115
Kendo.Mvc.UI.Fluent.TooltipBuilder.ToHtmlString() +52
System.Web.HttpUtility.HtmlEncode(Object value) +91
System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter writer, Object content) +48
System.Web.WebPages.WebPageBase.Write(Object value) +53
ASP._Page_Views_Shared_QuickMenu_cshtml.Execute() in c:\EPM\v6.0\Source\Presentation\Web\Views\Shared\QuickMenu.cshtml:21
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +271
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +121
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +191
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +763
System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +383
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +432
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +39
System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +78
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +388
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +72
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +303
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +155
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +184
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +137
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +66
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +50
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +152
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +68
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +50
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +152
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +65
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +39
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +50
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +152
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +66
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
System.Web.Mvc.<>c__DisplayClassa.<EndProcessRequest>b__9() +51
System.Web.Mvc.<>c__DisplayClass4.<Wrap>b__3() +41
System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +69
System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Action action) +123
System.Web.Mvc.ServerExecuteHttpHandlerAsyncWrapper.EndProcessRequest(IAsyncResult result) +133
System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +1743

[HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.]
System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +3544
System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +151
System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +122
System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +61
System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +985
System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) +112
System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName) +46
ASP._Page_Views_Shared__RootLayout_cshtml.<Execute>b__d(TextWriter __razor_template_writer) in c:\EPM\v6.0\Source\Presentation\Web\Views\Shared\_RootLayout.cshtml:153
System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +42
Kendo.Mvc.UI.<>c__DisplayClass7.<set_InlineTemplate>b__6(TextWriter writer) +128
Kendo.Mvc.UI.HtmlElement.WriteTo(TextWriter output) +213
Kendo.Mvc.UI.<>c__DisplayClass5.<WriteTo>b__3(IHtmlNode child) +45
Kendo.Mvc.Extensions.EnumerableExtensions.Each(IEnumerable`1 instance, Action`1 action) +194
Kendo.Mvc.UI.HtmlElement.WriteTo(TextWriter output) +333
Kendo.Mvc.UI.Splitter.WriteHtml(HtmlTextWriter writer) +82
Kendo.Mvc.UI.WidgetBase.ToHtmlString() +115
Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString() +62
System.Web.HttpUtility.HtmlEncode(Object value) +91
System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter writer, Object content) +48
System.Web.WebPages.WebPageBase.Write(Object value) +53
ASP._Page_Views_Shared__RootLayout_cshtml.Execute() in c:\EPM\v6.0\Source\Presentation\Web\Views\Shared\_RootLayout.cshtml:93
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +271
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +121
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +191
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer) +52
System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +333
System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +42
System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter writer, HelperResult content) +44
System.Web.WebPages.WebPageBase.Write(HelperResult result) +52
System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +195
System.Web.WebPages.WebPageBase.PopContext() +342
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +200
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +763
System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +383
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +432
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +39
System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +78
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +388
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +72
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +303
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +155
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +184
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +137
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +66
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +50
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +152
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +68
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +50
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +152
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +65
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +39
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +48
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +50
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +152
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +66
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +930
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +188

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.33440
Rosen
Telerik team
 answered on 03 Dec 2013
1 answer
118 views
I know this may be outside the scope of things here. 

I have a telerik Ajax.net website that is used in a similar way to the likes of wetransfer.com 

after a a recent pen test the security guys were able to get around the filters in place and spoof some files onto the server and gain remote access. 

Obviously not a good thing. So the site has been taken off line, 

I was looking to upgrade the site using kendo and was wondering if you had any advice on how I can try and prevent this sort of tampering or point me in the right direction to try and secure the site. 

The site is a great idea for helping transfer large files to groups of people and getting past email restrictions so any ideas would be greatly received. 

Dimiter Madjarov
Telerik team
 answered on 02 Dec 2013
1 answer
727 views
Hi

Is it possible to configure the Treeview checkboxes so that when a node's children are all deselected, the node is not deselected also? I need the CheckChildren functionality turned on so that children are automatically selected when their parent is. But I don't want the parent removed from the selection when its children are unchecked.

To illustrate I have set up a jsbin . I'd like to be able to select nodes a, b1 and b2. However b2 only shows checked when any of c1, c2 and c3 are checked. I can use CheckChildren(false) to allow selection of b1 and b2 individually, but I have much more data than this example so manually checking all the nodes would become too much for the user.

Here is how I am currently placing the treeview on the page (Model.Items is a list of TreeViewItemModel instances):

@Html.Kendo().TreeView().Name("treeview").BindTo(Model.Items).ExpandAll(true).Checkboxes(c => c
        .Enabled(true)        
        .CheckChildren(true)
        )

Any thoughts?
Petur Subev
Telerik team
 answered on 02 Dec 2013
1 answer
468 views
Hi,

I have a grid which is displaying a custom styled template looking like this with kendo default theme installed (See "fleetlist-kendo-default.PNG")
At this point the following is installed:
<link rel="stylesheet" href="@Url.Content("~/Content/Kendo/kendo.common.min.css")">
<link rel="stylesheet" href="@Url.Content("~/Content/Kendo/kendo.default.min.css")">
However, when I change the theme to Bootstrap so that it can match the rest of my Bootstrap-themed application (Bootstrap 3.x) the template and its styling seems to get overriden (See "fleetlist-kendo-bootstrap.PNG")
At this point the following is installed:
<link rel="stylesheet" href="@Url.Content("~/Content/Kendo/kendo.common-bootstrap.min.css")">
<link rel="stylesheet" href="@Url.Content("~/Content/Kendo/kendo.bootstrap.min.css")"/>
On the other hand, if I apply the flat theme, it works again.
What can I do? :)

Regards,
Nicklas
Dimo
Telerik team
 answered on 29 Nov 2013
1 answer
441 views
On page load we build a grid based on a DataTable model, we have a for each loop to generate the columns. Then from a kendo dropdown list we select a new ID which on selection, fires the dataSource.read method, passing the new ID. This returns a different dataset with different columns. The grid refreshes and shows the correct number of items/rows but the old columns remain and the grid is empty. The grid is not displaying the new columns.

I have tried to destroy and empty the grid before dataSource.read but then get a dataSource is undefined console error. See setup code below:

Grid:
@(Html.Kendo().Grid(Model)
    .Name("Grid")
    .Columns(columns =>
    {
        foreach (System.Data.DataColumn column in Model.Columns)
        {
            columns.Bound(column.ColumnName).Hidden(column.ColumnName == "CustID").Title(column.ColumnName.ToString().Replace(" ", ""));
        }
        columns.Bound("CustID").Title("").ClientTemplate("<a href='/Customers/Customer/#: CustID #'>More Details</a>");
    })
    .Pageable()
    .Sortable()
    .Filterable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(15)
        .ServerOperation(false)
        .Model(model =>
            {
                foreach (System.Data.DataColumn column in Model.Columns)
                {
                    model.Field(column.ColumnName, column.DataType);
                }
            })
        .Read(read => read.Action("CustomerDataRead", "Customers", new { _CustomerListID = 18 }))
    )
)
The dropdown list select function:
function select(e) {
    var dataItem = this.dataItem(e.item.index());
    if (dataItem.CustomerListID == "") {dataItem.CustomerListID = -1}
    //$('#Grid').data().kendoGrid.destroy();
    //$('#Grid').empty();
    $("#Grid").data("kendoGrid").dataSource.read({ _CustomerListID: dataItem.CustomerListID});
}
In the select event above, I pass the ID to the read method. 

The grid refreshes, but the old columns do not update but the number of items returns is correct. See this screenshot:
http://prntscr.com/26yio5

If the dataset returned by dataSource.read has the same columns as the original grid, the grid refreshes OK and the data is displayed.

If I destroy and empty the grid, the dataSource.read method fails:
"Uncaught TypeError: Cannot read property 'dataSource' of undefined "

How to update the grid with new columns in each subsequent dataSource.read






Daniel
Telerik team
 answered on 29 Nov 2013
1 answer
102 views
Can't tab to focus the content pane of an editor generated by a client side template
Dimiter Madjarov
Telerik team
 answered on 29 Nov 2013
1 answer
437 views
Hello,

I have Kendo selectable Grid being created in razor.
After row is selected user can delete the selected row. But since the grid has multiple pages, after deletion -  reloading contents of data I need the selection to be put on the next row, preserving the current page number...

How can I achieve that?

Thank you for your prompt answer.

Shabtai
Dimiter Madjarov
Telerik team
 answered on 28 Nov 2013
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?