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

Unable to get The PopUp GridEditMode and Batch Editing in MVC2 and Telerik 2010.1.416

1 Answer 22 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.
Doug
Top achievements
Rank 1
Doug asked on 01 Nov 2011, 07:54 AM

Hello,
       I am using 'MVC2' and 'Telerik 2010.1.416'.When I click on edit button it gives me a update and cancel button,where I can update only one row in which I made the change.I want that row to be displayed as a popup
as shown in the link where the Edit Mode is 'PopUp'
http://demos.telerik.com/aspnet-mvc/Grid/EditingServerSide/1?mode=PopUp&type=Text&theme=vista&Grid-mode=edit.  But in my view below I am getting the error at ".Editable(editing => editing.Mode(mode))"
which is not allowing me to set the edit mode as 'popup'.Can we acheive this PopUp functionality only in MVC3 Framework and Telerik 2011?.Also I am even unable to do "Batch Editing" for the grid where we update all the changes made in the grid.Can this Batch Editing functionality can also be acheived only in MVC3 Framework and Telerik 2011?.Any suggestions will be greately appreciated...

Thanks,
Satish.

View:
<%

 

@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SLIC.Models.SLICAccountModel>" %>

 

<%

 

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

 

 

 

 

<

 

 

asp:Content ID="ContentTitle" ContentPlaceHolderID="TitleContent" runat="server">

 

 

 

 

 

 

<%

 

: ViewData["applicationName"] %>

 

- Details-

<%

 

= Model.FRN %>

 

 

 

 

</

 

 

asp:Content>

 

<

 

 

asp:Content ID="ContentHeader" ContentPlaceHolderID="HeaderContent" runat="server">

 

</

 

 

asp:Content>

 

<

 

 

asp:Content ID="ContentPage" ContentPlaceHolderID="PageContent" runat="server">

 

 

 

 

 

 

 

 

<div id="MenuPage">

 

 

 

 

 

 

 

 

<span id="PageTitle">OCC List

 

<%

 

: Model.FRN %>

 

 

 

</span>

 

 

 

 

 

 

 

 

<hr />

 

 

 

 

 

 

 

 

<br />

 

 

 

 

 

 

 

 

<div class="Center">

 

 

 

 

 

 

<%

 

= Html.ValidationSummary() %>

 

<% if (TempData["formMessage"] != null && TempData["formMessage"].ToString() != "")

{%>

 

 

<span class="RedBold">&nbsp;<%: TempData["formMessage"].ToString() %>&nbsp;</span>

 

 

 

 

 

 

 

 

<br />

 

 

 

 

 

 

 

 

<br />

 

 

 

 

 

 

<%}%>

 

 

<span><strong>OCCList</strong></span>

 

 

 

 

 

 

 

 

<br />

 

 

 

 

 

 

 

 

</div>

 

 

 

 

 

 

 

 

<br />

 

 

 

 

 

 

<%

 

-- <form name="OCC" method="post" onclick = "Update" action="<%= Url.Action("Update", new{ FRN = Model.FRN})%>">--%>

 

 

 

<tr>

 

 

 

 

 

 

 

 

<td class="Left">

 

 

 

 

 

 

<% Html.Telerik().Grid(Model.AppliedOCC)

.Name("AppliedOCC")

.Footer(false)

.DataKeys(dataKeys => dataKeys.Add(key => key.FRN))

.DataBinding(dataBinding => dataBinding.Server().Select("AppliedOCC", "SLICAccount", new { FRN = Model.FRN, mode = GridEditMode.PopUp }).Update("Update", "SLICAccount", new { FRN = Model.FRN, mode = GridEditMode.PopUp }))

.Columns(columns =>

{

columns.Bound(sr => sr.OCC_ID).Title("OCC_ID").HeaderHtmlAttributes(

new { style = "font-weight: bold;" }).Width(100);

columns.Bound(sr => sr.OCC_DATE).Title("OCC Date").Format("{0:MM/dd/yyyy}").HeaderHtmlAttributes(

new { style = "font-weight: bold;" }).Width(100);

columns.Bound(sr => sr.PROD_ID).Title("Product I.D").HeaderHtmlAttributes(

new { style = "font-weight: bold;" }).Width(100);

columns.Bound(sr => sr.CUST_ID).Title("Customer I.D").HeaderHtmlAttributes(

new { style = "font-weight: bold;" }).Width(100);

columns.Bound(sr => sr.ACCT_NO).Title("Account Number").HeaderHtmlAttributes(

new { style = "font-weight: bold;" }).Width(100);

columns.Bound(sr => sr.MOBIL_PHONE).Title("MTN").HeaderHtmlAttributes(

new { style = "font-weight: bold;" }).Width(100);

columns.Bound(sr => sr.SPI_MONTH).Title("SPI Month").HeaderHtmlAttributes(

new { style = "font-weight: bold;" }).Width(80);

columns.Bound(sr => sr.EFF_DATE).Title("Effective Date").Format("{0:MM/dd/yyyy}").HeaderHtmlAttributes(

new { style = "font-weight: bold;" }).Width(100);

columns.Bound(sr => sr.BILLING_MONTH).Title("Billing Month").Format("{0:MM/dd/yyyy}").HeaderHtmlAttributes(

new { style = "font-weight: bold;" }).Width(100);

columns.Bound(sr => sr.SLC_DISCOUNT).Title("Discount").HeaderHtmlAttributes(

new { style = "font-weight: bold;" }).Width(70);

columns.Bound(sr => sr.USERID).Title("UserI.D").HeaderHtmlAttributes(

new { style = "font-weight: bold;" }).Width(70);

columns.Bound(sr => sr.PROCESSED).Title("Processed").HeaderHtmlAttributes(

new { style = "font-weight: bold;" }).Width(85);

columns.Bound(sr => sr.NOTE).Title("Notes").HeaderHtmlAttributes(

new { style = "font-weight: bold;" }).Width(100);

columns.Command(commands => { commands.Edit(); }).Width(200);

; %>

<%})

.Editable(editing => editing.Mode(mode)) //I am getting the error here
.Filterable()

.Selectable()

 

</td>

</tr>

</div>

</asp:Content>

<asp:Content ID="ContentFooter" ContentPlaceHolderID="FooterContent" runat="server">

</asp:Content>

Controller:

 

    [RequiresPermission(RequiredPermission = "Viewer")]

        [GridAction]

        public ActionResult AppliedOCC(string FRN)

        {

            SLICAccountModel _SLICAccountModel = new SLICAccountModel(FRN) { FormMode = "Edit" };

            SetViewData(FRN);

            _SLICAccountModel.GetAppliedOCC(FRN);

            SLICRepository _SLICRepository = new SLICRepository();

            //return View("OCCList", new ViewDataDictionary(_SLICAccountModel.AppliedOCC));

            return View("OCCList", _SLICAccountModel);

        }

 

        public ActionResult Update(string FRN, IEnumerable<SLICAccountModel> _SLICAccountModel1)

        {

            SLICAccountModel _SLICAccountModel = new SLICAccountModel();

            string SPI_MONTH = Request.Form["SPI_MONTH"];

            string OCC_ID = Request.Form["OCC_ID"];

            string UpdateOCCList = _SLICAccountModel.UpdateOCCList(FRN, SPI_MONTH, OCC_ID);

            if (UpdateOCCList == "Success")

            {

                TempData["formMessage"] = "Update Success";

            }

            _SLICAccountModel.GetAppliedOCC(FRN);

            return View("OCCList",_SLICAccountModel);

        }

 

Model:

 

    public List<SL_FRN_OCC> GetAppliedOCC(string _frn)

        {

            AppliedOCC = _SLICRepository.GetAppliedOCC(_frn).ToList();

            return AppliedOCC;

        }

 

 

        public string UpdateOCCList(string FRN, string SPI_MONTH, string OCC_ID)

        {

            string UpdateOCCList = _SLICRepository.UpdateOCCList(FRN, SPI_MONTH, OCC_ID);

            return UpdateOCCList;

        }

 

Repository:

 

  internal string UpdateOCCList(string FRN, string SPI_MONTH,string OCC_ID)

        {

            try

            {

                int OCC_IDVALUE = Convert.ToInt32(OCC_ID);

                SL_FRN_OCC OCCListDetails = (from sql in _SLICEntities.SL_FRN_OCC

                                             where sql.FRN == FRN && sql.OCC_ID == OCC_IDVALUE

                                             select sql).FirstOrDefault();

                int SPI_MONTH_VALUE = Convert.ToInt32(SPI_MONTH);

                if (OCCListDetails != null)

                {

                    OCCListDetails.SPI_MONTH = SPI_MONTH_VALUE;

                }

                _SLICEntities.SaveChanges();

                return "Success";

            }

            catch (Exception e)

            {

                throw new Exception("DB:ERROR => Models->Repository->SLICRepository->UpdateOCCList()", e);

            }

        }

 

    internal IList<SL_FRN_OCC> GetAppliedOCC(string FRN)

        {

            try

            {

                List<SL_FRN_OCC> AppliedOCC = (from sql in _SLICEntities.SL_FRN_OCC

                                               where sql.FRN == FRN

                                               orderby sql.FRN

                                               select sql).ToList();

                return AppliedOCC;

            }

            catch (Exception e)

            {

                throw new Exception("DB:ERROR => Models->Repository->SLICRepository->GetAppliedOCC", e);

 

            }

}

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 01 Nov 2011, 09:37 AM
Hi Doug,

Grid's popUp editing functionality is first introduced with Q2 2010 release of Telerik Extensions for ASP.NET MVC. And the InCell editing functionality is available from Q1 2011 release onward.

However, please have in mind that we are always suggest to use the latest version possible, as components are being constantly improved.

All the best,
Rosen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
Doug
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or