This is a migrated thread and some comments may be shown as answers.

[Solved] Telerik MVC Grid Command Button throwing errors.

1 Answer 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stephen
Top achievements
Rank 1
Stephen asked on 11 Apr 2011, 04:35 PM
Hi,
I'm currently having trouble with my implementation of the telerik MVC grid. It works as expected on my local machine and on dev. dervers, but once deployed to production, seems to break for reasons i'm not entirely sure of.
The production server has the .Net framework 3.5 installed and the rest of my MVC application works without any issues.

Here is my current implementation of the grid: (Telerik MVC Grid 2010.3.1318)

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Grid.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<QualifiedUsers>>" %>
 
<asp:Content ID="QualifiedUsersGrid" ContentPlaceHolderID="MainContent" runat="server">
    <%= Html.Telerik().Grid<QualifiedUsers>()
        .Name("Grid")
        .DataKeys(keys => keys.Add(c => c.QualifiedUserId))
        .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text).ImageHtmlAttributes(new { style = "margin-left:0" }))
        .DataBinding(dataBinding => dataBinding.Ajax()
            .Select("_Index", "Users")
            .Insert("_Create", "Users")
            .Update("_Update", "Users"))
        .Columns(columns =>
        {
            columns.Bound(c => c.QualifiedUserId).Width(50).Filterable(false).Sortable(false);
            columns.Bound(c => c.PartnerId).Width(120);
            columns.Bound(c => c.FiscalId).Width(100);
            columns.Bound(c => c.PaymentId).Width(150).Title("GCI");
            columns.Bound(c => c.UserName).Width(300).HtmlAttributes(new { style = "text-align:left" });
            columns.Bound(c => c.Bias).Format("{0:N}").Width(120);
            columns.Bound(c => c.InnerId).Width(150);
            columns.Bound(c => c.ChangedDate).Format("{0:MM/dd/yyyy}").Width(100);
        })
        .Filterable()
        .Selectable()
        .Sortable()
        .Scrollable(scrolling => scrolling.Height(320))
        .Pageable(x => x.PageSize(10))
        .Editable(editing => editing.Mode(GridEditMode.PopUp))
        .HtmlAttributes(new { style = "margin-bottom: 1.3em" })
        .ClientEvents(events => events.OnLoad("onQualifiedUserLoad").OnEdit("onQualifiedUserEdit"))
    %>
</asp:Content>

The version above works in production but does not give me the opportunity to edit QualifiedUsers via the grid.
When i add the following code to the grid:

columns.Command(commands =>
{
       commands.Edit().ButtonType(GridButtonType.Text);
}).Width(100).Title("Commands");

The application fails, with the error below:

StackTrace:    at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
   at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
   at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
   at System.Web.Mvc.ViewPage.RenderView(ViewContext viewContext)
   at System.Web.Mvc.WebFormView.RenderViewPage(ViewContext context, ViewPage page)
   at System.Web.Mvc.WebFormView.Render(ViewContext viewContext, TextWriter writer)
   at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass14.<InvokeActionResultWithFilters>b__11()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
   at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass14.<>c__DisplayClass16.<InvokeActionResultWithFilters>b__13()
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
   at System.Web.Mvc.Controller.ExecuteCore()
   at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
   at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext)
   at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__4()
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0()
   at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
   at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag)
   at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag)
   at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Inner Exception: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Inner Stack Trace :    at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at System.Web.Mvc.ViewPage.ProcessRequest(HttpContext context)
   at ASP.views_users_index_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\0d9d9a41\1e191e88\App_Web_a39f2xwa.0.cs:line 0
   at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass1.<ProcessRequest>b__0()
   at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.<Wrap>b__3()
   at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func)
   at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.ProcessRequest(HttpContext context)
   at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
 
Source: System.Web


Any ideas? i would really appreciate it!

1 Answer, 1 is accepted

Sort by
0
Stephen
Top achievements
Rank 1
answered on 15 Apr 2011, 09:46 AM
Anyone? I still haven't been able to figure out why this isn't working.
Tags
Grid
Asked by
Stephen
Top achievements
Rank 1
Answers by
Stephen
Top achievements
Rank 1
Share this question
or